]> git.lyx.org Git - features.git/commitdiff
Assign InsetBibtex to appropriate toc level
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 15 May 2020 08:14:22 +0000 (10:14 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 15 May 2020 08:14:22 +0000 (10:14 +0200)
Fixes #11863

src/insets/InsetBibtex.cpp

index bf70c44ae8ce08de6b91a5812cd0bb3b1b379e5d..15953e1cded7dec4a6455e55c8c18e05df1e02ce 100644 (file)
@@ -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> 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));
 }