summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2009-08-14 14:49:07 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2009-08-14 14:49:07 (GMT)
commit9e6be9a8ae24b788cf2463a703bda48cbd77c773 (patch)
treefed426d0d7216311cbd009a1fcd2786176478b5e /src/util.cpp
parent6e28050ef5483e624122b0bacb998c40664f78ee (diff)
downloadDoxygen-9e6be9a8ae24b788cf2463a703bda48cbd77c773.zip
Doxygen-9e6be9a8ae24b788cf2463a703bda48cbd77c773.tar.gz
Doxygen-9e6be9a8ae24b788cf2463a703bda48cbd77c773.tar.bz2
Release-1.5.9-20090814
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp40
1 files changed, 29 insertions, 11 deletions
diff --git a/src/util.cpp b/src/util.cpp
index d6519c4..d349b8d 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -3135,7 +3135,12 @@ static QCString getCanonicalTypeForIdentifier(
//printf(" mtype=%s\n",mType?mType->name().data():"<none>");
- if (cd) // resolves to a known class type
+ if (cd && cd==d)
+ {
+ *tSpec="";
+ return "";
+ }
+ else if (cd) // resolves to a known class type
{
if (mType && mType->isTypedef()) // but via a typedef
{
@@ -3217,9 +3222,10 @@ static QCString extractCanonicalType(Definition *d,FileDef *fs,QCString type)
//printf("extractCanonicalType(type=%s) start: def=%s file=%s\n",type.data(),
// d ? d->name().data() : "<null>",fs ? fs->name().data() : "<null>");
- static QRegExp id("[a-z_A-Z\\x80-\\xFF][:a-z_A-Z0-9\\x80-\\xFF]*");
+ //static QRegExp id("[a-z_A-Z\\x80-\\xFF][:a-z_A-Z0-9\\x80-\\xFF]*");
- QCString canType,templSpec,word;
+ QCString canType;
+ QCString templSpec,word;
int i,p=0,pp=0;
while ((i=extractClassNameFromType(type,p,word,templSpec))!=-1)
// foreach identifier in the type
@@ -3228,7 +3234,19 @@ static QCString extractCanonicalType(Definition *d,FileDef *fs,QCString type)
if (i>pp) canType += type.mid(pp,i-pp);
- canType += getCanonicalTypeForIdentifier(d,fs,word,&templSpec);
+ QCString ct = getCanonicalTypeForIdentifier(d,fs,word,&templSpec);
+
+ // in case the ct is empty it means that "word" represents scope "d"
+ // and this does not need to be added to the canonical
+ // type (it is redundant), so/ we skip it. This solves problem 589616.
+ if (ct.isEmpty() && type.mid(p,2)=="::")
+ {
+ p+=2;
+ }
+ else
+ {
+ canType += ct;
+ }
//printf(" word=%s templSpec=%s canType=%s\n",word.data(),templSpec.data(),canType.data());
if (!templSpec.isEmpty()) // if we didn't use up the templSpec already
// (i.e. type is not a template specialization)
@@ -3259,7 +3277,7 @@ static QCString extractCanonicalArgType(Definition *d,FileDef *fs,const Argument
{
QCString type = arg->type.stripWhiteSpace();
QCString name = arg->name;
- //printf("extractCanonicalArgType(type=%s,name=%s)\n",type.data(),name.data());
+ //printf("----- extractCanonicalArgType(type=%s,name=%s)\n",type.data(),name.data());
if ((type=="const" || type=="volatile") && !name.isEmpty())
{ // name is part of type => correct
type+=" ";
@@ -4252,7 +4270,7 @@ QCString linkToText(const char *link,bool isFileName)
return result;
}
-/*!
+/*
* generate a reference to a class, namespace or member.
* `scName' is the name of the scope that contains the documentation
* string that is returned.
@@ -5614,10 +5632,10 @@ QCString stripTemplateSpecifiersFromScope(const QCString &fullName,
result+=fullName.mid(p,i-p);
//printf(" trying %s\n",(result+fullName.mid(i,e-i)).data());
- if (getClass(result+fullName.mid(i,e-i))!=0)
+ if (getClass(result+fullName.mid(i,e-i))!=0)
{
result+=fullName.mid(i,e-i);
- //printf("2:result+=%s\n",fullName.mid(i,e-i-1).data());
+ //printf(" 2:result+=%s cd=%s\n",fullName.mid(i,e-i-1).data(),cd->name().data());
}
else if (pLastScopeStripped)
{
@@ -5827,8 +5845,8 @@ void addRefItem(const QList<ListItemInfo> *sli,
{
RefItem *item = refList->getRefItem(lii->itemId);
ASSERT(item!=0);
- //printf("anchor=%s written=%d\n",item->listAnchor.data(),item->written);
- if (item->written) return;
+ printf("anchor=%s written=%d\n",item->listAnchor.data(),item->written);
+ //if (item->written) return;
QCString doc(1000);
doc = "\\anchor ";
@@ -5845,7 +5863,7 @@ void addRefItem(const QList<ListItemInfo> *sli,
doc += item->text;
doc += "</dd></dl>\n";
addRelatedPage(refList->listName(),refList->pageTitle(),doc,0,refList->listName(),1,0,0,0);
- item->written=TRUE;
+ //item->written=TRUE;
}
}
}