]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetText.cpp
Correctly handle environment sequences in TOC
[features.git] / src / insets / InsetText.cpp
index ed2633b429dad7d29596470ea797a273a36964de..8b77149d8d9212e8d3f7e7340ea530f2de6ead04 100644 (file)
@@ -821,7 +821,7 @@ void InsetText::addToToc(DocIterator const & cdit) const
                                arginset = inset.asInsetText();
                }
                // now the toc entry for the paragraph
-               int const toclevel = par.layout().toclevel;
+               int const toclevel = text().getTocLevel(pit);
                if (toclevel != Layout::NOT_IN_TOC && toclevel >= min_toclevel) {
                        // insert this into the table of contents
                        docstring tocstring;