names_->blockSignals(true);
names_->beginResetModel();
names_->insertColumns(0, 1);
+ // In the outliner, add Tocs from the master document
TocBackend const & backend = bv->buffer().masterBuffer()->tocBackend();
- TocList const & tocs = backend.tocs();
- TocList::const_iterator it = tocs.begin();
- TocList::const_iterator toc_end = tocs.end();
- for (; it != toc_end; ++it) {
- QString const type = toqstr(it->first);
+ for (pair<string, shared_ptr<Toc>> const & toc : backend.tocs()) {
+ QString const type = toqstr(toc.first);
// First, fill in the toc models.
iterator mod_it = models_.find(type);
if (mod_it == models_.end())
mod_it = models_.insert(type, new TocModel(this));
- mod_it.value()->reset(it->second);
+ mod_it.value()->reset(toc.second);
// Fill in the names_ model.
- QString const gui_name = toqstr(backend.outlinerName(it->first));
+ QString const gui_name = toqstr(backend.outlinerName(toc.first));
int const current_row = names_->rowCount();
names_->insertRows(current_row, 1);
QModelIndex const index = names_->index(current_row, 0);