Skip to content

Commit 8373928

Browse files
committed
issue #10349 Autolinks to functions point to the struct with the same name
1 parent 0dd71c6 commit 8373928

File tree

1 file changed

+10
-24
lines changed

1 file changed

+10
-24
lines changed

src/util.cpp

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -977,42 +977,28 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
977977
}
978978
}
979979
}
980-
if (!found && (cd || (cd=getClass(matchWord))))
981-
{
982-
//printf("Found class %s\n",qPrint(cd->name()));
983-
// add link to the result
980+
auto writeCompoundName = [&](const auto *cd) {
984981
if (external ? cd->isLinkable() : cd->isLinkableInProject())
985982
{
986-
if (cd!=self)
983+
if (cd->qualifiedName()!=self->qualifiedName())
987984
{
988985
out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word.c_str());
989986
found=TRUE;
990987
}
991988
}
989+
};
990+
if (!found && (cd || (cd=getClass(matchWord))))
991+
{
992+
//printf("Found class %s\n",qPrint(cd->name()));
993+
writeCompoundName(cd);
992994
}
993995
else if ((cd=getClass(matchWord+"-p"))) // search for Obj-C protocols as well
994996
{
995-
// add link to the result
996-
if (external ? cd->isLinkable() : cd->isLinkableInProject())
997-
{
998-
if (cd!=self)
999-
{
1000-
out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word.c_str());
1001-
found=TRUE;
1002-
}
1003-
}
997+
writeCompoundName(cd);
1004998
}
1005-
else if ((cnd=getConcept(matchWord)))
999+
else if ((cnd=getConcept(matchWord))) // search for concepts
10061000
{
1007-
// add link to the result
1008-
if (external ? cnd->isLinkable() : cnd->isLinkableInProject())
1009-
{
1010-
if (cnd!=self)
1011-
{
1012-
out.writeLink(cnd->getReference(),cnd->getOutputFileBase(),cnd->anchor(),word.c_str());
1013-
found=TRUE;
1014-
}
1015-
}
1001+
writeCompoundName(cnd);
10161002
}
10171003
else
10181004
{

0 commit comments

Comments
 (0)