diff options
author | Lorenz Haas <lykurg@gmail.com> | 2013-10-05 21:15:43 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-10-07 11:23:41 +0200 |
commit | e3d95168a08c36a8cca4f08d906d3a6162eff9f5 (patch) | |
tree | 3f5ce63b54eb43b93ee63c465242396a93b64b56 /src/plugins/cppeditor/cppquickfixes.cpp | |
parent | 2cbb64e0f9dd84be29a5890a57e232d783e90259 (diff) | |
download | qt-creator-e3d95168a08c36a8cca4f08d906d3a6162eff9f5.tar.gz |
CppEditor: Fix insert position in MoveFuncDefToDecl
When a class was directly assigned to a variable the definition was
misplaced right after the variable.
Task-number: QTCREATORBUG-10303
Change-Id: I2cdfee784b085d856d7ff5ebe62bf791b9a6754e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Diffstat (limited to 'src/plugins/cppeditor/cppquickfixes.cpp')
-rw-r--r-- | src/plugins/cppeditor/cppquickfixes.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index a6d9dd1900..4802a3a346 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -4387,7 +4387,7 @@ void MoveFuncDefToDecl::match(const CppQuickFixInterface &interface, QuickFixOpe const CppRefactoringFilePtr declFile = refactoring.file(declFileName); ASTPath astPath(declFile->cppDocument()); const QList<AST *> path = astPath(s->line(), s->column()); - for (int idx = 0; idx < path.size(); ++idx) { + for (int idx = path.size() - 1; idx > 0; --idx) { AST *node = path.at(idx); if (SimpleDeclarationAST *simpleDecl = node->asSimpleDeclaration()) { if (simpleDecl->symbols && !simpleDecl->symbols->next) { |