commit 5c80671740ec803be7ce35b1f1844ffa438575a2
Author: Thibaut Cuvelier <tcuvel...@lyx.org>
Date:   Mon Apr 25 03:34:29 2022 +0200

    InsetIndex: add a method hasSubentries.
---
 src/insets/InsetIndex.cpp |   17 +++++++++++++++++
 src/insets/InsetIndex.h   |    2 ++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp
index afa25f1..8a75622 100644
--- a/src/insets/InsetIndex.cpp
+++ b/src/insets/InsetIndex.cpp
@@ -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();
diff --git a/src/insets/InsetIndex.h b/src/insets/InsetIndex.h
index 3a22b3b..ccf214b 100644
--- a/src/insets/InsetIndex.h
+++ b/src/insets/InsetIndex.h
@@ -106,6 +106,8 @@ private:
        ///
        std::vector<docstring> getSeeAlsoesAsText(OutputParams const & 
runparams) const;
        ///
+       bool hasSubentries() const;
+       ///
        bool hasSeeRef() const;
        ///
        bool hasSortKey() const;
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to