Commit 0b9ce529 authored by Andre Hartmann's avatar Andre Hartmann Committed by Erik Verbruggen

C++ Macro Usages: Refactoring

Change-Id: I959e0aeeec3164fdd997c08b6d4ed4e95a39009f
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 97925eaf
......@@ -573,22 +573,21 @@ _Lrestart:
const Macro &useMacro = use.macro();
if (useMacro.fileName() == macro.fileName()) { // Check if this is a match, but possibly against an outdated document.
if (source.isEmpty())
source = getSource(fileName, workingCopy);
if (macro.fileRevision() > useMacro.fileRevision()) {
// yes, it is outdated, so re-preprocess and start from scratch for this file.
source = getSource(fileName, workingCopy).toLatin1();
doc = snapshot.preprocessedDocument(source, fileName);
goto _Lrestart;
}
}
if (useMacro.fileName() == macro.fileName() && macro.name() == useMacro.name()) {
if (source.isEmpty())
source = getSource(fileName, workingCopy);
unsigned lineStart;
const QString &lineSource = matchingLine(use.begin(), source, &lineStart);
usages.append(Usage(fileName, lineSource, use.beginLine(),
use.begin() - lineStart, useMacro.name().length()));
if (macro.name() == useMacro.name()) {
unsigned lineStart;
const QString &lineSource = matchingLine(use.begin(), source, &lineStart);
usages.append(Usage(fileName, lineSource, use.beginLine(),
use.begin() - lineStart, useMacro.name().length()));
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment