]> 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>
Sat, 16 May 2020 07:02:55 +0000 (09:02 +0200)
Fixes #11863

(cherry picked from commit 92ba05c53b572de0be27c66818a6e10ee6719280)

src/insets/InsetBibtex.cpp
status.23x

index e4c7f302c4ac63411e4133fe67bc80abc8019a9d..11079647dacef33a0dba2ad2a02054c533a0b286 100644 (file)
@@ -901,9 +901,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));
 }
 
 
index 02def57e90818da0accaf49d0a3fd50c2a59a549..a34e52e65aa4fa1e53520ee5190499f0b94e870b 100644 (file)
@@ -123,6 +123,9 @@ What's new
 
 - Fix disappearing selection with clipboard managers on X11 (bug 11715).
 
+- Correct hierarchy level of Bib(la)tex inset in outliner if "Show in Toc"
+  is selected (bug 11863).
+
 
 * INTERNALS