From 991ef3840e3516bdf9085a8194ad549916d7f449 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Fri, 15 May 2020 10:14:22 +0200 Subject: [PATCH] Assign InsetBibtex to appropriate toc level Fixes #11863 (cherry picked from commit 92ba05c53b572de0be27c66818a6e10ee6719280) --- src/insets/InsetBibtex.cpp | 9 ++++++--- status.23x | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index e4c7f302c4..11079647da 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -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 = 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)); } diff --git a/status.23x b/status.23x index 02def57e90..a34e52e65a 100644 --- a/status.23x +++ b/status.23x @@ -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 -- 2.39.5