forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Nikolai Kosjar
parent
2cbb64e0f9
commit
e3d95168a0
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user