diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-04-09 19:37:39 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-04-09 19:37:39 (GMT) |
commit | 9fad20ca14c175f75e1bfbe887034e14d3c77bd1 (patch) | |
tree | 1a6e48f2d93100a63e4d1ac4ff3716b3d67df215 | |
parent | bc83eb68e2fd31faa4b1ca7bb6610b30c0a24659 (diff) | |
parent | a32c1f37eabd83c1d4f9865796a95bd85b6e775d (diff) | |
download | Doxygen-9fad20ca14c175f75e1bfbe887034e14d3c77bd1.zip Doxygen-9fad20ca14c175f75e1bfbe887034e14d3c77bd1.tar.gz Doxygen-9fad20ca14c175f75e1bfbe887034e14d3c77bd1.tar.bz2 |
Merge branch 'albert-github-feature/issue_7692'
-rw-r--r-- | src/docparser.cpp | 70 | ||||
-rw-r--r-- | src/util.cpp | 5 | ||||
-rw-r--r-- | src/util.h | 1 |
3 files changed, 37 insertions, 39 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp index 7ece3ef..8191533 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -662,7 +662,6 @@ static bool insideTable(DocNode *n) } //--------------------------------------------------------------------------- - /*! Looks for a documentation block with name commandName in the current * context (g_context). The resulting documentation string is * put in pDoc, the definition in which the documentation was found is @@ -679,11 +678,44 @@ static bool findDocsForMemberOrCompound(const char *commandName, *pDoc=""; *pBrief=""; *pDef=0; - QCString cmdArg=substitute(commandName,"#","::"); - cmdArg = replaceScopeSeparator(cmdArg); + QCString cmdArg=commandName; + if (cmdArg.isEmpty()) return FALSE; + + const FileDef *fd=0; + const GroupDef *gd=0; + const PageDef *pd=0; + gd = Doxygen::groupSDict->find(cmdArg); + if (gd) // group + { + *pDoc=gd->documentation(); + *pBrief=gd->briefDescription(); + *pDef=gd; + return TRUE; + } + pd = Doxygen::pageSDict->find(cmdArg); + if (pd) // page + { + *pDoc=pd->documentation(); + *pBrief=pd->briefDescription(); + *pDef=pd; + return TRUE; + } + bool ambig; + fd = findFileDef(Doxygen::inputNameLinkedMap,cmdArg,ambig); + if (fd && !ambig) // file + { + *pDoc=fd->documentation(); + *pBrief=fd->briefDescription(); + *pDef=fd; + return TRUE; + } + + // for symbols we need to normalize the separator, so A#B, or A\B, or A.B becomes A::B + cmdArg = substitute(cmdArg,"#","::"); + cmdArg = substitute(cmdArg,"\\","::"); + cmdArg = substitute(cmdArg,".","::"); int l=(int)cmdArg.length(); - if (l==0) return FALSE; int funcStart=cmdArg.find('('); if (funcStart==-1) @@ -710,10 +742,7 @@ static bool findDocsForMemberOrCompound(const char *commandName, // try if the link is to a member const MemberDef *md=0; const ClassDef *cd=0; - const FileDef *fd=0; const NamespaceDef *nd=0; - const GroupDef *gd=0; - const PageDef *pd=0; bool found = getDefs( g_context.find('.')==-1?g_context.data():"", // find('.') is a hack to detect files name, @@ -756,32 +785,6 @@ static bool findDocsForMemberOrCompound(const char *commandName, *pDef=nd; return TRUE; } - gd = Doxygen::groupSDict->find(cmdArg); - if (gd) // group - { - *pDoc=gd->documentation(); - *pBrief=gd->briefDescription(); - *pDef=gd; - return TRUE; - } - pd = Doxygen::pageSDict->find(cmdArg); - if (pd) // page - { - *pDoc=pd->documentation(); - *pBrief=pd->briefDescription(); - *pDef=pd; - return TRUE; - } - bool ambig; - fd = findFileDef(Doxygen::inputNameLinkedMap,cmdArg,ambig); - if (fd && !ambig) // file - { - *pDoc=fd->documentation(); - *pBrief=fd->briefDescription(); - *pDef=fd; - return TRUE; - } - if (scopeOffset==0) { scopeOffset=-1; @@ -796,6 +799,7 @@ static bool findDocsForMemberOrCompound(const char *commandName, return FALSE; } + //--------------------------------------------------------------------------- inline void errorHandleDefaultToken(DocNode *parent,int tok, QList<DocNode> &children,const char *txt) diff --git a/src/util.cpp b/src/util.cpp index 4de28cf..6d6112e 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -7933,11 +7933,6 @@ QCString getLanguageSpecificSeparator(SrcLangExt lang,bool classScope) return "::"; } } -QCString replaceScopeSeparator(QCString str) -{ - // we don't know about the language so we have to go for the worse - return substitute(substitute(str,"\\","::"),".","::"); // PHP and Java, CSharp, VHDL, Python -} /** Checks whether the given url starts with a supported protocol */ bool isURL(const QCString &url) { @@ -118,7 +118,6 @@ class LetterToIndexMap : public SIntDict<T> QCString langToString(SrcLangExt lang); QCString getLanguageSpecificSeparator(SrcLangExt lang,bool classScope=FALSE); -QCString replaceScopeSeparator(QCString str); //-------------------------------------------------------------------- |