summaryrefslogtreecommitdiff
path: root/src/plugins/cppeditor
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@nokia.com>2010-09-29 10:25:38 +0200
committerErik Verbruggen <erik.verbruggen@nokia.com>2010-09-29 11:35:21 +0200
commit588bc1f78ca1fcc9be7bf6230977bc6e4a7ce255 (patch)
tree5a730f76eb4389f6b524f9401fb488037fe757b7 /src/plugins/cppeditor
parent87250689ef60d87d97103e0a6b1cff2fed25c9c2 (diff)
downloadqt-creator-588bc1f78ca1fcc9be7bf6230977bc6e4a7ce255.tar.gz
CPPEditor: Fixed invalid location in refactoring action.
Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/plugins/cppeditor')
-rw-r--r--src/plugins/cppeditor/cppinsertdecldef.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/cppeditor/cppinsertdecldef.cpp b/src/plugins/cppeditor/cppinsertdecldef.cpp
index 5a4e641a4d..2d51b5849e 100644
--- a/src/plugins/cppeditor/cppinsertdecldef.cpp
+++ b/src/plugins/cppeditor/cppinsertdecldef.cpp
@@ -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());