]> git.lyx.org Git - lyx.git/blobdiff - src/TocBackend.cpp
Cmake build: Creating a define for a header file found
[lyx.git] / src / TocBackend.cpp
index 656f326e15c956aef9495823e5d6ef97f8261800..e3dcca1d0e59a201b268d397f91f9772561e2aa2 100644 (file)
@@ -118,7 +118,7 @@ Toc & TocBackend::toc(string const & type)
 
 bool TocBackend::updateItem(DocIterator const & dit)
 {
-       if (dit.paragraph().layout().toclevel == Layout::NOT_IN_TOC)
+       if (dit.text()->getTocLevel(dit.pit()) == Layout::NOT_IN_TOC)
                return false;
 
        if (toc("tableofcontents").empty()) {
@@ -154,7 +154,7 @@ bool TocBackend::updateItem(DocIterator const & dit)
                }
        }
 
-       int const toclevel = par.layout().toclevel;
+       int const toclevel = toc_item->dit_.text()->getTocLevel(toc_item->dit_.pit());
        if (toclevel != Layout::NOT_IN_TOC && toclevel >= min_toclevel
                && tocstring.empty())
                        tocstring = par.asString(AS_STR_LABEL | AS_STR_INSETS);