X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetInclude.cpp;h=482fdb2110f434afd9594dfc17d11f1033a40457;hb=3391fed36a574fb729f243888258d1b6d45b0251;hp=c39b7d349fb52467f7d6386778fea522e9a5e51f;hpb=461fda9ca9a8079f235fe6d26031aa6b9c5ff36e;p=features.git diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index c39b7d349f..482fdb2110 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -1141,12 +1141,11 @@ void InsetInclude::addPreview(DocIterator const & /*inset_pos*/, void InsetInclude::addToToc(DocIterator const & cpit, bool output_active, - UpdateType utype) const + UpdateType utype, TocBackend & backend) const { - TocBackend & backend = buffer().tocBackend(); if (isListings(params())) { if (label_) - label_->addToToc(cpit, output_active, utype); + label_->addToToc(cpit, output_active, utype, backend); TocBuilder & b = backend.builder("listing"); b.pushItem(cpit, screenLabel(), output_active); InsetListingsParams p(to_utf8(params()["lstparams"])); @@ -1165,13 +1164,7 @@ void InsetInclude::addToToc(DocIterator const & cpit, bool output_active, return; // Include Tocs from children - childbuffer->tocBackend().update(output_active, utype); - for(auto const & pair : childbuffer->tocBackend().tocs()) { - string const & type = pair.first; - shared_ptr child_toc = pair.second; - shared_ptr toc = backend.toc(type); - toc->insert(toc->end(), child_toc->begin(), child_toc->end()); - } + childbuffer->inset().addToToc(cpit, 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).