Skip to content

Commit 1b179d3

Browse files
committed
issue doxygen#11683 duplicates in searchdata.xml "text" field
In case of an inherited member the, brief, text of the inherited member should not be added to the search text field.
1 parent 6c329ac commit 1b179d3

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/docnode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ DocWord::DocWord(DocParser *parser,DocNodeVariant *parent,const QCString &word)
180180
DocNode(parser,parent), m_word(word)
181181
{
182182
//printf("new word %s url=%s\n",qPrint(word),qPrint(parser->context.searchUrl));
183-
if (Doxygen::searchIndex.enabled() && !parser->context.searchUrl.isEmpty())
183+
if (Doxygen::searchIndex.enabled() && !Doxygen::searchIndex.inherited() && !parser->context.searchUrl.isEmpty())
184184
{
185185
Doxygen::searchIndex.addWord(word,false);
186186
}

src/memberdef.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,11 +2614,13 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
26142614
)
26152615
{
26162616
auto parser { createDocParser() };
2617+
Doxygen::searchIndex.setInherited(inheritedFrom!=nullptr);
26172618
auto ast { validatingParseDoc(*parser.get(),
26182619
briefFile(),briefLine(),
26192620
getOuterScope()?getOuterScope():d,
26202621
this,briefDescription(),TRUE,FALSE,
26212622
QCString(),TRUE,FALSE) };
2623+
Doxygen::searchIndex.setInherited(false);
26222624
if (!ast->isEmpty())
26232625
{
26242626
ol.startMemberDescription(anchor(),inheritId);

src/searchindex.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,11 @@ class SearchIndexIntf
188188
}
189189
}
190190
Kind kind() const { return m_kind; }
191+
void setInherited(bool inh) {m_inherited = inh;}
192+
bool inherited() {return m_inherited;}
191193
private:
192194
Kind m_kind;
195+
bool m_inherited = false;
193196
SearchIndexVariant m_variant;
194197
};
195198

0 commit comments

Comments
 (0)