Skip to content

Commit 4e2b97b

Browse files
authored
Merge pull request doxygen#12040 from albert-github/feature/bug_129682_brief
bug 129682 Wrong function dependency is made
2 parents db1ca34 + 3e3687e commit 4e2b97b

4 files changed

Lines changed: 31 additions & 5 deletions

File tree

src/classdef.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,7 @@ void ClassDefImpl::writeTemplateSpec(OutputList &ol,const Definition *d,
15211521
getFileDef(), // fileScope
15221522
this, // self
15231523
a.type, // text
1524+
nullptr,
15241525
FALSE // autoBreak
15251526
);
15261527
if (!a.name.isEmpty())
@@ -1547,6 +1548,7 @@ void ClassDefImpl::writeTemplateSpec(OutputList &ol,const Definition *d,
15471548
getFileDef(), // fileScope
15481549
this, // self
15491550
m_requiresClause, // text
1551+
nullptr,
15501552
FALSE // autoBreak
15511553
);
15521554
ol.lineBreak();

src/memberdef.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
11881188
n=addTemplateNames(n,scope->name(),cName);
11891189
}
11901190
ol.startParameterDefVal(" = ");
1191-
linkifyText(TextGeneratorOLImpl(ol),scope,md->getBodyDef(),md,n,FALSE,TRUE,TRUE);
1191+
linkifyText(TextGeneratorOLImpl(ol),scope,md->getBodyDef(),md,n,nullptr,FALSE,TRUE,TRUE);
11921192
ol.endParameterDefVal();
11931193
}
11941194
++alIt;
@@ -1251,6 +1251,7 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
12511251
md->getBodyDef(), // fileScope
12521252
md, // self
12531253
defArgList.trailingReturnType(), // text
1254+
nullptr,
12541255
FALSE // autoBreak
12551256
);
12561257

@@ -2181,6 +2182,7 @@ void MemberDefImpl::_writeTemplatePrefix(OutputList &ol, const Definition *def,
21812182
getFileDef(), // fileScope
21822183
this, // self
21832184
a.type, // text
2185+
nullptr,
21842186
FALSE // autoBreak
21852187
);
21862188
if (!a.name.isEmpty())
@@ -2206,6 +2208,7 @@ void MemberDefImpl::_writeTemplatePrefix(OutputList &ol, const Definition *def,
22062208
getFileDef(), // fileScope
22072209
this, // self
22082210
m_requiresClause, // text
2211+
nullptr, // arguments for names
22092212
TRUE, // autoBreak
22102213
TRUE, // external
22112214
FALSE, // keepSpaces
@@ -2390,11 +2393,12 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
23902393
getBodyDef(), // fileScope
23912394
this, // self
23922395
ltype.left(i), // text
2396+
nullptr, // arguments for names
23932397
FALSE // autoBreak
23942398
);
23952399
getAnonymousEnumType()->writeEnumDeclaration(ol,cd,nd,fd,gd,mod);
23962400
//ol+=*getAnonymousEnumType()->enumDecl();
2397-
linkifyText(TextGeneratorOLImpl(ol),d,getFileDef(),this,ltype.right(ltype.length()-i-l),TRUE);
2401+
linkifyText(TextGeneratorOLImpl(ol),d,getFileDef(),this,ltype.right(ltype.length()-i-l),nullptr,TRUE);
23982402
}
23992403
else
24002404
{
@@ -2404,6 +2408,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
24042408
getBodyDef(), // fileScope
24052409
this, // self
24062410
ltype, // text
2411+
nullptr, // arguments for names
24072412
FALSE // autoBreak
24082413
);
24092414
}
@@ -2425,6 +2430,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
24252430
getBodyDef(), // fileScope
24262431
this, // self
24272432
ltype, // text
2433+
nullptr, // arguments for names
24282434
FALSE // autoBreak
24292435
);
24302436
}
@@ -2517,6 +2523,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
25172523
isTypedef() ?
25182524
substitute(argsString(),")(",") (") :
25192525
combineArgsAndException(argsString(),excpString()), // text
2526+
&m_defArgList,
25202527
m_annMemb!=nullptr, // autoBreak
25212528
TRUE, // external
25222529
FALSE, // keepSpaces
@@ -4082,7 +4089,7 @@ void MemberDefImpl::writeMemberDocSimple(OutputList &ol, const Definition *conta
40824089
ol.docify(doxyName);
40834090
if (isVariable() && !argsString().isEmpty() && !isObjCMethod() && !isFunctionPtr())
40844091
{
4085-
linkifyText(TextGeneratorOLImpl(ol),getOuterScope(),getBodyDef(),this,argsString());
4092+
linkifyText(TextGeneratorOLImpl(ol),getOuterScope(),getBodyDef(),this,argsString(),&m_defArgList);
40864093
}
40874094
if (!m_bitfields.isEmpty()) // add bitfields
40884095
{

src/util.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,13 +892,16 @@ bool leftScopeMatch(const QCString &scope, const QCString &name)
892892

893893
void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
894894
const FileDef *fileScope,const Definition *self,
895-
const QCString &text, bool autoBreak,bool external,
895+
const QCString &text,
896+
const ArgumentList *al,
897+
bool autoBreak,bool external,
896898
bool keepSpaces,int indentLevel,size_t breakThreshold)
897899
{
898900
AUTO_TRACE("scope={} fileScope={} text={} autoBreak={} external={} keepSpaces={} indentLevel={}",
899901
scope?scope->name():"",fileScope?fileScope->name():"",
900902
text,autoBreak,external,keepSpaces,indentLevel);
901903
if (text.isEmpty()) return;
904+
902905
//printf("linkify='%s'\n",qPrint(text));
903906
std::string_view txtStr=text.view();
904907
size_t strLen = txtStr.length();
@@ -974,9 +977,22 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
974977
// get word from string
975978
std::string_view word=txtStr.substr(newIndex,matchLen);
976979
QCString matchWord = substitute(substitute(word,"\\","::"),".","::");
980+
bool found=false;
981+
// check for argument name
982+
if (al)
983+
{
984+
for (auto it1 = al->begin(); it1!=al->end(); ++it1)
985+
{
986+
if (it1->name == matchWord)
987+
{
988+
out.writeString(matchWord.data(),keepSpaces);
989+
found = true;
990+
break;
991+
}
992+
}
993+
}
977994
//printf("linkifyText word=%s matchWord=%s scope=%s\n",
978995
// qPrint(word),qPrint(matchWord),scope ? qPrint(scope->name()) : "<none>");
979-
bool found=FALSE;
980996
if (!insideString)
981997
{
982998
const ClassDef *cd=nullptr;

src/util.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ void linkifyText(const TextGeneratorIntf &ol,
9797
const FileDef *fileScope,
9898
const Definition *self,
9999
const QCString &text,
100+
const ArgumentList *al = nullptr,
100101
bool autoBreak=FALSE,
101102
bool external=TRUE,
102103
bool keepSpaces=FALSE,

0 commit comments

Comments
 (0)