]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetIndex.cpp
InsetIndex: add a method hasSubentries.
[features.git] / src / insets / InsetIndex.cpp
index afa25f10fcc53f47806f176fce61c55f32d23956..8a75622c45f60b1c10ea06e5e327d5fefc85a85b 100644 (file)
@@ -769,6 +769,23 @@ std::vector<docstring> InsetIndex::getSeeAlsoesAsText(OutputParams const & runpa
 }
 
 
+bool InsetIndex::hasSubentries() const
+{
+       Paragraph const & par = paragraphs().front();
+       InsetList::const_iterator it = par.insetList().begin();
+       for (; it != par.insetList().end(); ++it) {
+               Inset & inset = *it->inset;
+               if (inset.lyxCode() == INDEXMACRO_CODE) {
+                       InsetIndexMacro const & iim =
+                               static_cast<InsetIndexMacro const &>(inset);
+                       if (iim.params().type == InsetIndexMacroParams::Subindex)
+                               return true;
+               }
+       }
+       return false;
+}
+
+
 bool InsetIndex::hasSeeRef() const
 {
        Paragraph const & par = paragraphs().front();