forked from qt-creator/qt-creator
C++: Fix Macrouse::utf16charsBegin()
This caused displaced highlighting of macro uses after #if constructs. MacroUse::utf16charBegin() was based on the last "continuation token", which was wrong. Change-Id: I89983d82fcf804ba853c04a59a7533c489785d05 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -1788,6 +1788,7 @@ QByteArray Preprocessor::expand(PPToken *tk, PPToken *lastConditionToken)
|
||||
{
|
||||
unsigned line = tk->lineno;
|
||||
unsigned bytesBegin = tk->bytesBegin();
|
||||
unsigned utf16charsBegin = tk->utf16charsBegin();
|
||||
PPToken lastTk;
|
||||
while (isContinuationToken(*tk)) {
|
||||
lastTk = *tk;
|
||||
@@ -1801,7 +1802,7 @@ QByteArray Preprocessor::expand(PPToken *tk, PPToken *lastConditionToken)
|
||||
QByteArray result;
|
||||
result.reserve(256);
|
||||
preprocess(m_state.m_currentFileName, condition, &result, 0, true, false, true,
|
||||
bytesBegin, tk->utf16charsBegin(), line);
|
||||
bytesBegin, utf16charsBegin, line);
|
||||
result.squeeze();
|
||||
// qDebug("*** Condition after: [%s]", result.constData());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user