From 5c80671740ec803be7ce35b1f1844ffa438575a2 Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Mon, 25 Apr 2022 03:34:29 +0200 Subject: [PATCH] InsetIndex: add a method hasSubentries. --- src/insets/InsetIndex.cpp | 17 +++++++++++++++++ src/insets/InsetIndex.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index afa25f10fc..8a75622c45 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -769,6 +769,23 @@ std::vector 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(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 3a22b3b772..ccf214b2e1 100644 --- a/src/insets/InsetIndex.h +++ b/src/insets/InsetIndex.h @@ -106,6 +106,8 @@ private: /// std::vector getSeeAlsoesAsText(OutputParams const & runparams) const; /// + bool hasSubentries() const; + /// bool hasSeeRef() const; /// bool hasSortKey() const; -- 2.39.2