diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2001-11-18 14:52:40 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2001-11-18 14:52:40 (GMT) |
commit | c736b03f16a88b6654ff9c1ae680e46b86e50218 (patch) | |
tree | 066b0bffed86445dbe3d494eaf31515f5b743e8c /src/code.l | |
parent | fba77445463c412e6b514174df590fdce58838cf (diff) | |
download | Doxygen-c736b03f16a88b6654ff9c1ae680e46b86e50218.zip Doxygen-c736b03f16a88b6654ff9c1ae680e46b86e50218.tar.gz Doxygen-c736b03f16a88b6654ff9c1ae680e46b86e50218.tar.bz2 |
Release-1.2.12
Diffstat (limited to 'src/code.l')
-rw-r--r-- | src/code.l | 51 |
1 files changed, 37 insertions, 14 deletions
@@ -330,12 +330,12 @@ static void startCodeLine() //if (g_currentFontClass) { g_code->endFontClass(); } if (g_sourceFileDef) { - QCString lineNumber,lineAnchor; - lineNumber.sprintf("%05d",g_yyLineNr); - lineAnchor.sprintf("l%05d",g_yyLineNr); + //QCString lineNumber,lineAnchor; + //lineNumber.sprintf("%05d",g_yyLineNr); + //lineAnchor.sprintf("l%05d",g_yyLineNr); Definition *d = g_sourceFileDef->getSourceDefinition(g_yyLineNr); - g_code->startLineNumber(); + //g_code->startLineNumber(); if (!g_includeCodeFragment && d && d->isLinkableInProject()) { g_currentDefinition = d; @@ -347,16 +347,19 @@ static void startCodeLine() //printf("Real scope: `%s'\n",g_realScope.data()); g_bodyCurlyCount = 0; if (g_currentMemberDef) anchor=g_currentMemberDef->getBodyAnchor(); - g_code->startCodeAnchor(lineAnchor); - g_code->writeCodeLink(d->getReference(),d->getOutputFileBase(), - anchor,lineNumber); - g_code->endCodeAnchor(); + //g_code->startCodeAnchor(lineAnchor); + //g_code->writeCodeLink(d->getReference(),d->getOutputFileBase(), + // anchor,lineNumber); + //g_code->endCodeAnchor(); + g_code->writeLineNumber(d->getReference(),d->getOutputFileBase(), + anchor,g_yyLineNr); } else { - g_code->codify(lineNumber); + //g_code->codify(lineNumber); + g_code->writeLineNumber(0,0,0,g_yyLineNr); } - g_code->endLineNumber(); + //g_code->endLineNumber(); } g_code->startCodeLine(); if (g_currentFontClass) @@ -556,12 +559,32 @@ static MemberDef *setCallContextForVar(const QCString &name) if ((mn=Doxygen::functionNameSDict[name])) { //printf("global var `%s'\n",name.data()); - if (mn->count()>=1) - // TODO: if count>1 link to static members in the same file only + if (mn->count()==1) // global defined only once { MemberDef *md=mn->getFirst(); - g_theCallContext.setClass(stripClassName(md->typeString())); - return md; + if (!md->isStatic() || md->getBodyDef()==g_sourceFileDef) + { + g_theCallContext.setClass(stripClassName(md->typeString())); + return md; + } + return 0; + } + else if (mn->count()>1) // global defined more than once + { + MemberDef *md=mn->first(); + while (md) + { + //printf("mn=%p md=%p md->getBodyDef()=%p g_sourceFileDef=%p\n", + // mn,md, + // md->getBodyDef(),g_sourceFileDef); + if (md->getBodyDef()==g_sourceFileDef) + { + g_theCallContext.setClass(stripClassName(md->typeString())); + return md; + } + md=mn->next(); + } + return 0; } } return 0; |