summaryrefslogtreecommitdiffstats
path: root/src/code.l
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2003-09-04 19:14:10 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2003-09-04 19:14:10 (GMT)
commitd20edf5ddd0f90ea5b220ad743bf311f74383fc8 (patch)
tree9eaad18e2e95d04758839bfe77adefaaa1695f7d /src/code.l
parent77a2ce8e15c967422cb1ff01dc78f5d9b1892c3d (diff)
downloadDoxygen-d20edf5ddd0f90ea5b220ad743bf311f74383fc8.zip
Doxygen-d20edf5ddd0f90ea5b220ad743bf311f74383fc8.tar.gz
Doxygen-d20edf5ddd0f90ea5b220ad743bf311f74383fc8.tar.bz2
Release-1.3.3-20030904
Diffstat (limited to 'src/code.l')
-rw-r--r--src/code.l38
1 files changed, 26 insertions, 12 deletions
diff --git a/src/code.l b/src/code.l
index 37a87d9..9680192 100644
--- a/src/code.l
+++ b/src/code.l
@@ -648,19 +648,17 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,
QCString className=clName;
if (className.isEmpty()) return;
ClassDef *cd=0;
+ MemberDef *md=0;
if (!g_theVarContext.findVariable(className)) // not a local variable
{
Definition *d = g_currentDefinition;
- cd = getResolvedClass(d,g_sourceFileDef,className);
- if (cd==0 && (i=className.find('<'))!=-1)
+ cd = getResolvedClass(d,g_sourceFileDef,className,&md);
+ if (cd==0 && md==0 && (i=className.find('<'))!=-1)
{
- cd=getResolvedClass(d,g_sourceFileDef,className.left(i));
+ cd=getResolvedClass(d,g_sourceFileDef,className.left(i),&md);
}
}
- else
- {
- }
if (cd && cd->isLinkable()) // is it a linkable class
{
//printf("is linkable class %s\n",clName);
@@ -677,17 +675,33 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,
}
}
writeMultiLineCodeLink(ol,cd->getReference(),cd->getOutputFileBase(),0,className);
+ if (md)
+ {
+ Definition *d = md->getOuterScope()==Doxygen::globalScope ?
+ md->getBodyDef() : md->getOuterScope();
+ if (md->getGroupDef()) d = md->getGroupDef();
+ if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef)
+ {
+ addDocCrossReference(g_currentMemberDef,md);
+ }
+ }
}
else
{
- //printf("class %s not linkable! cd=%p\n",clName,cd);
- //printf("typeOnly=%d\n",typeOnly);
- if (cd==0 && !typeOnly) // not a class, see if it is a global enum/variable/typedef.
+ //printf("class %s not linkable! cd=%p md=%p typeOnly=%d\n",clName,cd,md,typeOnly);
+ if (md!=0 || (cd==0 && !typeOnly)) // not a class, see if it is a global enum/variable/typedef.
{
- MemberDef *md = setCallContextForVar(clName);
- //printf("is a global md=%p g_currentDefinition=%s\n",md,g_currentDefinition?g_currentDefinition->name().data():"<none>");
- if (md && (g_currentDefinition==0 || isAccessibleFrom(g_currentDefinition,g_sourceFileDef,md)!=-1))
+ if (md==0) // not found as a typedef
+ {
+ md = setCallContextForVar(clName);
+ if (md && g_currentDefinition!=0 && !isAccessibleFrom(g_currentDefinition,g_sourceFileDef,md)==-1)
+ {
+ md=0; // variable not accessible
+ }
+ }
+ if (md)
{
+ //printf("is a global md=%p g_currentDefinition=%s\n",md,g_currentDefinition?g_currentDefinition->name().data():"<none>");
Definition *d = md->getOuterScope()==Doxygen::globalScope ?
md->getBodyDef() : md->getOuterScope();
//printf("definition %s\n",d?d->name().data():"<none>");