Fixed the line retreival for find-usages.

Instead of using the pre-processed source, the original one is used.
This makes a difference when a macro is used in the line, where the pre-
processed source would have a "#gen true" token.

Task-number: QTCREATORBUG-3345
This commit is contained in:
Erik Verbruggen
2011-01-17 14:41:19 +01:00
parent 673f9871ba
commit dea74862d3
3 changed files with 9 additions and 29 deletions

View File

@@ -115,11 +115,12 @@ public:
Document::Ptr doc;
QByteArray source;
const QString unpreprocessedSource = getSource(fileName, workingCopy);
if (symbolDocument && fileName == symbolDocument->fileName())
doc = symbolDocument;
else {
source = snapshot.preprocessedCode(getSource(fileName, workingCopy), fileName);
source = snapshot.preprocessedCode(unpreprocessedSource, fileName);
doc = snapshot.documentFromSource(source, fileName);
doc->tokenize();
}
@@ -129,7 +130,7 @@ public:
if (doc != symbolDocument)
doc->check();
FindUsages process(doc, snapshot);
FindUsages process(unpreprocessedSource.toUtf8(), doc, snapshot);
process(symbol);
usages = process.usages();