diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2001-11-18 14:52:40 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2001-11-18 14:52:40 (GMT) |
commit | b89fdced7a88c9222faa0d646923bd09fb1765f8 (patch) | |
tree | 066b0bffed86445dbe3d494eaf31515f5b743e8c /src/code.l | |
parent | f11235dce05843401bccaae6dfcee8f65ac9da1d (diff) | |
download | Doxygen-b89fdced7a88c9222faa0d646923bd09fb1765f8.zip Doxygen-b89fdced7a88c9222faa0d646923bd09fb1765f8.tar.gz Doxygen-b89fdced7a88c9222faa0d646923bd09fb1765f8.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; |