- shared_ptr<Toc> toc = backend.toc("child");
- docstring str = childbuffer->fileName().displayName();
- toc->push_back(TocItem(cpit, 0, str, output_active));
-
- childbuffer->tocBackend().update(output_active, utype);
- TocList const & childtoclist = childbuffer->tocBackend().tocs();
- TocList::const_iterator it = childtoclist.begin();
- TocList::const_iterator const end = childtoclist.end();
- for(; it != end; ++it) {
- shared_ptr<Toc> toc = backend.toc(it->first);
- toc->insert(toc->end(), it->second->begin(), it->second->end());
- }
+ // Include Tocs from children
+ childbuffer->inset().addToToc(DocIterator(), output_active, utype,
+ backend);
+ //Copy missing outliner names (though the user has been warned against
+ //having different document class and module selection between master
+ //and child).
+ for (pair<string, docstring> const & name
+ : childbuffer->params().documentClass().outlinerNames())
+ backend.addName(name.first, translateIfPossible(name.second));