summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppfindreferences.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@nokia.com>2011-01-17 14:41:19 +0100
committerErik Verbruggen <erik.verbruggen@nokia.com>2011-01-17 14:47:20 +0100
commitdea74862d3d0cf7b4624bbb39069bb0fd3435644 (patch)
treef6d4da7665a71d6eb652d776798f370be381bba5 /src/plugins/cpptools/cppfindreferences.cpp
parent673f9871baceb9cfffc8ea199be548cd39803f53 (diff)
downloadqt-creator-dea74862d3d0cf7b4624bbb39069bb0fd3435644.tar.gz
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
Diffstat (limited to 'src/plugins/cpptools/cppfindreferences.cpp')
-rw-r--r--src/plugins/cpptools/cppfindreferences.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp
index 71efe5cf26..479f55c354 100644
--- a/src/plugins/cpptools/cppfindreferences.cpp
+++ b/src/plugins/cpptools/cppfindreferences.cpp
@@ -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();