]> git.lyx.org Git - lyx.git/blobdiff - src/TextClass.cpp
* GuiDocument.cpp: before accessing the buffer() in paramsToDialog(), check
[lyx.git] / src / TextClass.cpp
index 5e077de161fb7b752c1d58e45e73b1f4638c8fe2..981dcd185c23b99d256cfca5f4add1c9fb26b8e9 100644 (file)
@@ -66,7 +66,7 @@ private:
 };
 
 // Keep the changes documented in the Customization manual. 
-int const FORMAT = 21;
+int const FORMAT = 22;
 
 
 bool layout2layout(FileName const & filename, FileName const & tempfile)
@@ -1276,15 +1276,14 @@ Layout const & DocumentClass::htmlTOCLayout() const
 {
        if (html_toc_section_.empty()) {
                // we're going to look for the layout with the minimum toclevel
-               // number > 0, because we don't want Part. 
-               // we'll take the first one, just because.
                TextClass::LayoutList::const_iterator lit = begin();
                TextClass::LayoutList::const_iterator const len = end();
                int minlevel = 1000;
                Layout const * lay = NULL;
                for (; lit != len; ++lit) {
                        int const level = lit->toclevel;
-                       if (level > 0 && (level == Layout::NOT_IN_TOC || level >= minlevel))
+                       // we don't want Part
+                       if (level == Layout::NOT_IN_TOC || level < 0 || level >= minlevel)
                                continue;
                        lay = &*lit;
                        minlevel = level;