C++: Add utf16 indices to Macro and Document::MacroUse

In most cases we need to work with the utf16 indices. Only in
cppfindreferences the byte interface is still needed since there we read
in files and work on a QByteArray to save memory.

Change-Id: I6ef6a93fc1875a8c9a305c075d51a9ca034c41bb
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-05-09 10:04:13 -04:00
parent bb7da966b8
commit c6358e5d38
24 changed files with 345 additions and 215 deletions

View File

@@ -1751,7 +1751,7 @@ void CppCompletionAssistProcessor::addMacros_helper(const CPlusPlus::Snapshot &s
addMacros_helper(snapshot, i.resolvedFileName(), processed, definedMacros);
foreach (const Macro &macro, doc->definedMacros()) {
const QString macroName = QString::fromUtf8(macro.name().constData(), macro.name().length());
const QString macroName = macro.nameToQString();
if (!macro.isHidden())
definedMacros->insert(macroName);
else