Implemented Rename Macro Usages

Works the same way as Rename Usages for C++ Symbols.

For now, no Search Again as this requieres further work.

Task-number: QTCREATORBUG-413

Change-Id: I09e85ea1e8c247f5ce0b6bc566aba8018c1569e4
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
Andre Hartmann
2012-03-17 13:26:27 +01:00
committed by Leandro Melo
parent 6147419f87
commit 44a3a5e070
6 changed files with 36 additions and 5 deletions

View File

@@ -742,10 +742,14 @@ void CPPEditorWidget::renameUsagesNow(const QString &replacement)
info.snapshot = CppModelManagerInterface::instance()->snapshot();
info.snapshot.insert(info.doc);
CanonicalSymbol cs(this, info);
if (Symbol *canonicalSymbol = cs(textCursor()))
if (canonicalSymbol->identifier() != 0)
m_modelManager->renameUsages(canonicalSymbol, cs.context(), replacement);
if (const Macro *macro = findCanonicalMacro(textCursor(), info.doc)) {
m_modelManager->renameMacroUsages(*macro, replacement);
} else {
CanonicalSymbol cs(this, info);
if (Symbol *canonicalSymbol = cs(textCursor()))
if (canonicalSymbol->identifier() != 0)
m_modelManager->renameUsages(canonicalSymbol, cs.context(), replacement);
}
}
void CPPEditorWidget::renameUsages()