]> git.lyx.org Git - features.git/commitdiff
Fix bug #8608: Don't output index entries from notes, etc.
authorRichard Heck <rgheck@lyx.org>
Mon, 25 Mar 2013 21:33:54 +0000 (17:33 -0400)
committerRichard Heck <rgheck@lyx.org>
Mon, 25 Mar 2013 21:36:21 +0000 (17:36 -0400)
src/insets/InsetIndex.cpp

index de46f9b776210294368dca5d43bf14d05f3c7361..57c0d07a3a496e100ab7bacebfe0b42a4aa6c285 100644 (file)
@@ -689,12 +689,19 @@ docstring InsetPrintIndex::xhtml(XHTMLStream &, OutputParams const & op) const
        if (toc.empty())
                return docstring();
 
-       // Collection the index entries in a form we can use them.
+       // Collect the index entries in a form we can use them.
        Toc::const_iterator it = toc.begin();
        Toc::const_iterator const en = toc.end();
        vector<IndexEntry> entries;
        for (; it != en; ++it)
-               entries.push_back(IndexEntry(it->str(), it->dit()));
+               if (it->isOutput())
+                       entries.push_back(IndexEntry(it->str(), it->dit()));
+
+       if (entries.empty())
+               // not very likely that all the index entries are in notes or
+               // whatever, but....
+               return docstring();
+
        stable_sort(entries.begin(), entries.end());
 
        Layout const & lay = bp.documentClass().htmlTOCLayout();