InsetIndex: add a method hasSubentries.

This commit is contained in:
Thibaut Cuvelier 2022-04-25 03:34:29 +02:00
parent 029d8d5839
commit 5c80671740
2 changed files with 19 additions and 0 deletions

View 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 bool InsetIndex::hasSeeRef() const
{ {
Paragraph const & par = paragraphs().front(); Paragraph const & par = paragraphs().front();

View File

@ -106,6 +106,8 @@ private:
/// ///
std::vector<docstring> getSeeAlsoesAsText(OutputParams const & runparams) const; std::vector<docstring> getSeeAlsoesAsText(OutputParams const & runparams) const;
/// ///
bool hasSubentries() const;
///
bool hasSeeRef() const; bool hasSeeRef() const;
/// ///
bool hasSortKey() const; bool hasSortKey() const;