From c0b367ecd4a2f48cde85d4f5aed416892d3fa775 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 23 Nov 2018 13:21:51 +0100 Subject: issue #6632 References to Objective C protocols by name broken in 1.8.12 The issue is the change in the spacing for protocols. In 1.8.11 the option `-r functions` gave (a.o): `member callbackMethod of class MyProtocol-p` In 1.8.12 the result is: `member callbackMethod of class MyProtocol -p` (Note the extra space). --- src/reflist.cpp | 5 ++++- src/util.cpp | 11 ++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/reflist.cpp b/src/reflist.cpp index 7ae4c80..36206a8 100644 --- a/src/reflist.cpp +++ b/src/reflist.cpp @@ -162,7 +162,10 @@ void RefList::generatePage() if (item->scope->name() != "") { doc += "\\_setscope "; - doc += item->scope->name(); + if (item->scope->name().right(3)==" -p") + doc += item->scope->name().left(item->scope->name().length()-3) + "-p"; + else + doc += item->scope->name(); doc += " "; } } diff --git a/src/util.cpp b/src/util.cpp index 819903c..330fc57 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1424,8 +1424,12 @@ static ClassDef *getResolvedClassRec(const Definition *scope, di = Doxygen::symbolMap->find(name+"-p"); if (di==0) { - //printf("no such symbol!\n"); - return 0; + di = Doxygen::symbolMap->find(name+" -p"); + if (di==0) + { + //printf("no such symbol!\n"); + return 0; + } } //} } @@ -4556,7 +4560,8 @@ static bool getScopeDefs(const char *docScope,const char *scope, if (scopeOffset>0) fullName.prepend(docScopeName.left(scopeOffset)+"::"); if (((cd=getClass(fullName)) || // normal class - (cd=getClass(fullName+"-p")) //|| // ObjC protocol + (cd=getClass(fullName+"-p")) || // ObjC protocol + (cd=getClass(fullName+" -p")) //|| // ObjC protocol //(cd=getClass(fullName+"-g")) // C# generic ) && cd->isLinkable()) { -- cgit v0.12 From 890e3567470b0767c5ebe52207d1c75a96e888aa Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 24 Nov 2018 19:09:27 +0100 Subject: Fixed differently by changing root cause for introducing the space --- src/reflist.cpp | 5 +---- src/scanner.l | 2 +- src/util.cpp | 11 +++-------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/reflist.cpp b/src/reflist.cpp index fe87bd5..6f2a763 100644 --- a/src/reflist.cpp +++ b/src/reflist.cpp @@ -162,10 +162,7 @@ void RefList::generatePage() if (item->scope->name() != "") { doc += "\\_setscope "; - if (item->scope->name().right(3)==" -p") - doc += item->scope->name().left(item->scope->name().length()-3) + "-p"; - else - doc += item->scope->name(); + doc += item->scope->name(); doc += " "; } } diff --git a/src/scanner.l b/src/scanner.l index a0b4e83..7559e0b 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -5457,7 +5457,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } BEGIN( FindMembers ) ; } -{SCOPENAME}{BN}*/"<" { +{SCOPENAME}/{BN}*"<" { sharpCount = 0; current->name = yytext ; if (current->spec & Entry::Protocol) diff --git a/src/util.cpp b/src/util.cpp index 330fc57..819903c 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1424,12 +1424,8 @@ static ClassDef *getResolvedClassRec(const Definition *scope, di = Doxygen::symbolMap->find(name+"-p"); if (di==0) { - di = Doxygen::symbolMap->find(name+" -p"); - if (di==0) - { - //printf("no such symbol!\n"); - return 0; - } + //printf("no such symbol!\n"); + return 0; } //} } @@ -4560,8 +4556,7 @@ static bool getScopeDefs(const char *docScope,const char *scope, if (scopeOffset>0) fullName.prepend(docScopeName.left(scopeOffset)+"::"); if (((cd=getClass(fullName)) || // normal class - (cd=getClass(fullName+"-p")) || // ObjC protocol - (cd=getClass(fullName+" -p")) //|| // ObjC protocol + (cd=getClass(fullName+"-p")) //|| // ObjC protocol //(cd=getClass(fullName+"-g")) // C# generic ) && cd->isLinkable()) { -- cgit v0.12