diff options
Diffstat (limited to 'src/code.l')
-rw-r--r-- | src/code.l | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -123,6 +123,7 @@ static bool g_lexInit = FALSE; static QStack<int> g_classScopeLengthStack; static Definition *g_searchCtx; +static bool g_collectXRefs; // context for an Objective-C method call struct ObjCCallCtx @@ -885,7 +886,7 @@ static bool getLinkInScope(const QCString &c, // scope // g_currentDefinition,g_currentMemberDef,g_insideBody); if (g_currentDefinition && g_currentMemberDef && - md!=g_currentMemberDef && g_insideBody) + md!=g_currentMemberDef && g_insideBody && g_collectXRefs) { addDocCrossReference(g_currentMemberDef,md); } @@ -1018,7 +1019,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName Definition *d = md->getOuterScope()==Doxygen::globalScope ? md->getFileDef() : md->getOuterScope(); if (md->getGroupDef()) d = md->getGroupDef(); - if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef) + if (d && d->isLinkable() && md->isLinkable() && + g_currentMemberDef && g_collectXRefs) { addDocCrossReference(g_currentMemberDef,md); } @@ -1071,7 +1073,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName } writeMultiLineCodeLink(ol,md,text); addToSearchIndex(clName); - if (g_currentMemberDef) + if (g_currentMemberDef && g_collectXRefs) { addDocCrossReference(g_currentMemberDef,md); } @@ -1127,7 +1129,7 @@ static bool generateClassMemberLink(CodeOutputInterface &ol,MemberDef *xmd,const { // add usage reference if (g_currentDefinition && g_currentMemberDef && - /*xmd!=g_currentMemberDef &&*/ g_insideBody) + /*xmd!=g_currentMemberDef &&*/ g_insideBody && g_collectXRefs) { addDocCrossReference(g_currentMemberDef,xmd); } @@ -1504,7 +1506,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx) if (ctx->method && ctx->method->isLinkable()) { writeMultiLineCodeLink(*g_code,ctx->method,pName->data()); - if (g_currentMemberDef) + if (g_currentMemberDef && g_collectXRefs) { addDocCrossReference(g_currentMemberDef,ctx->method); } @@ -1583,7 +1585,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx) else if (ctx->objectVar && ctx->objectVar->isLinkable()) // object is class variable { writeMultiLineCodeLink(*g_code,ctx->objectVar,pObject->data()); - if (g_currentMemberDef) + if (g_currentMemberDef && g_collectXRefs) { addDocCrossReference(g_currentMemberDef,ctx->objectVar); } @@ -3537,9 +3539,10 @@ void resetCCodeParserState() } void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s, - SrcLangExt lang,bool exBlock, const char *exName,FileDef *fd, - int startLine,int endLine,bool inlineFragment, - MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx) + SrcLangExt lang,bool exBlock, const char *exName,FileDef *fd, + int startLine,int endLine,bool inlineFragment, + MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx, + bool collectXRefs) { //printf("***parseCode() exBlock=%d exName=%s fd=%p className=%s searchCtx=%s\n", // exBlock,exName,fd,className,searchCtx?searchCtx->name().data():"<none>"); @@ -3555,6 +3558,7 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s, g_currentFontClass = 0; g_needsTermination = FALSE; g_searchCtx = searchCtx; + g_collectXRefs = collectXRefs; g_inFunctionTryBlock = FALSE; if (endLine!=-1) g_inputLines = endLine+1; |