diff options
Diffstat (limited to 'src/plugins/cppeditor/cppcompleteswitch.cpp')
-rw-r--r-- | src/plugins/cppeditor/cppcompleteswitch.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/cppeditor/cppcompleteswitch.cpp b/src/plugins/cppeditor/cppcompleteswitch.cpp index 05ec2c440e..dd287f3987 100644 --- a/src/plugins/cppeditor/cppcompleteswitch.cpp +++ b/src/plugins/cppeditor/cppcompleteswitch.cpp @@ -116,15 +116,17 @@ public: } - virtual void performChanges(CppRefactoringFile *currentFile, CppRefactoringChanges *) + virtual void performChanges(const CppRefactoringFilePtr ¤tFile, + const CppRefactoringChanges &) { ChangeSet changes; int start = currentFile->endOf(compoundStatement->lbrace_token); changes.insert(start, QLatin1String("\ncase ") + values.join(QLatin1String(":\nbreak;\ncase ")) + QLatin1String(":\nbreak;")); - currentFile->change(changes); - currentFile->indent(currentFile->range(compoundStatement)); + currentFile->setChangeSet(changes); + currentFile->appendIndentRange(currentFile->range(compoundStatement)); + currentFile->apply(); } CompoundStatementAST *compoundStatement; |