From: Juergen Spitzmueller Date: Fri, 15 May 2020 08:14:22 +0000 (+0200) Subject: Assign InsetBibtex to appropriate toc level X-Git-Tag: lyx-2.4.0dev-acb2ca7b~873 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=92ba05c53b572de0be27c66818a6e10ee6719280;p=features.git Assign InsetBibtex to appropriate toc level Fixes #11863 --- diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index bf70c44ae8..15953e1cde 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -961,9 +961,12 @@ void InsetBibtex::addToToc(DocIterator const & cpit, bool output_active, return; docstring const str = getRefLabel(); - TocBuilder & b = backend.builder("tableofcontents"); - b.pushItem(cpit, str, output_active); - b.pop(); + shared_ptr toc = backend.toc("tableofcontents"); + // Assign to appropriate level + int const item_depth = + (buffer().masterParams().documentClass().hasLaTeXLayout("chapter")) + ? 1 : 2; + toc->push_back(TocItem(cpit, item_depth, str, output_active)); }