CPPEditor: Fixed invalid location in refactoring action.

Reviewed-by: Roberto Raggi
This commit is contained in:
Erik Verbruggen
2010-09-29 10:25:38 +02:00
parent 87250689ef
commit 588bc1f78c

View File

@@ -81,7 +81,9 @@ public:
void performChanges(CppRefactoringFile *, CppRefactoringChanges *refactoring)
{
InsertionPointLocator locator(state().snapshot());
Snapshot snapshot = state().snapshot();
snapshot.insert(refactoring->file(m_targetFileName).cppDocument());
InsertionPointLocator locator(snapshot);
const InsertionLocation loc = locator.methodDeclarationInClass(
m_targetFileName, m_targetSymbol, m_xsSpec);
Q_ASSERT(loc.isValid());