commit 92ba05c53b572de0be27c66818a6e10ee6719280
Author: Juergen Spitzmueller <[email protected]>
Date:   Fri May 15 10:14:22 2020 +0200

    Assign InsetBibtex to appropriate toc level
    
    Fixes #11863
---
 src/insets/InsetBibtex.cpp |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp
index bf70c44..15953e1 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> 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));
 }
 
 
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to