summaryrefslogtreecommitdiffstats
path: root/src/filedef.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/filedef.cpp')
-rw-r--r--src/filedef.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/filedef.cpp b/src/filedef.cpp
index 7bd6aeb..b12ecd3 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -807,6 +807,7 @@ void FileDef::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu)
static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
static bool filterSourceFiles = Config_getBool("FILTER_SOURCE_FILES");
static bool latexSourceCode = Config_getBool("LATEX_SOURCE_CODE");
+ DevNullCodeDocInterface devNullIntf;
QCString title = m_docname;
if (!m_fileVersion.isEmpty())
{
@@ -878,10 +879,33 @@ void FileDef::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu)
ParserInterface *pIntf = Doxygen::parserManager->getParser(getDefFileExtension());
pIntf->resetCodeParserState();
ol.startCodeFragment();
+ bool needs2PassParsing =
+ Doxygen::parseSourcesNeeded && // we need to parse (filtered) sources for cross-references
+ !filterSourceFiles && // but user wants to show sources as-is
+ !getFileFilter(absFilePath(),TRUE).isEmpty(); // and there is a filter used while parsing
+
+ if (needs2PassParsing)
+ {
+ // parse code for cross-references only (see bug707641)
+ pIntf->parseCode(devNullIntf,0,
+ fileToString(absFilePath(),TRUE,TRUE),
+ getLanguage(),
+ FALSE,0,this
+ );
+ }
pIntf->parseCode(ol,0,
fileToString(absFilePath(),filterSourceFiles,TRUE),
- getLanguage(),
- FALSE,0,this
+ getLanguage(), // lang
+ FALSE, // isExampleBlock
+ 0, // exampleName
+ this, // fileDef
+ -1, // startLine
+ -1, // endLine
+ FALSE, // inlineFragment
+ 0, // memberDef
+ TRUE, // showLineNumbers
+ 0, // searchCtx
+ !needs2PassParsing // collectXRefs
);
ol.endCodeFragment();
}