Commit 9ceabbac authored by Nicolas Arnaud-Cormos's avatar Nicolas Arnaud-Cormos Committed by Christian Kamm
Browse files

Create definition is available on the whole declaration line.



Merge-request: 390
Reviewed-by: default avatarChristian Kamm <christian.d.kamm@nokia.com>

Change-Id: I046b3046d3d0148b0fad694181f17737e12a85b6
Reviewed-on: http://codereview.qt-project.org/5529

Reviewed-by: default avatarChristian Kamm <christian.d.kamm@nokia.com>
parent 9357b054
...@@ -293,7 +293,6 @@ QList<CppQuickFixOperation::Ptr> DefFromDecl::match( ...@@ -293,7 +293,6 @@ QList<CppQuickFixOperation::Ptr> DefFromDecl::match(
const QSharedPointer<const Internal::CppQuickFixAssistInterface> &interface) const QSharedPointer<const Internal::CppQuickFixAssistInterface> &interface)
{ {
const QList<AST *> &path = interface->path(); const QList<AST *> &path = interface->path();
CppRefactoringFilePtr file = interface->currentFile();
int idx = path.size() - 1; int idx = path.size() - 1;
for (; idx >= 0; --idx) { for (; idx >= 0; --idx) {
...@@ -306,8 +305,6 @@ QList<CppQuickFixOperation::Ptr> DefFromDecl::match( ...@@ -306,8 +305,6 @@ QList<CppQuickFixOperation::Ptr> DefFromDecl::match(
&& !decl->type()->asFunctionType()->isPureVirtual() && !decl->type()->asFunctionType()->isPureVirtual()
&& decl->enclosingScope() && decl->enclosingScope()
&& decl->enclosingScope()->isClass()) { && decl->enclosingScope()->isClass()) {
DeclaratorAST *declarator = simpleDecl->declarator_list->value;
if (file->isCursorOn(declarator->core_declarator)) {
CppRefactoringChanges refactoring(interface->snapshot()); CppRefactoringChanges refactoring(interface->snapshot());
InsertionPointLocator locator(refactoring); InsertionPointLocator locator(refactoring);
QList<CppQuickFixOperation::Ptr> results; QList<CppQuickFixOperation::Ptr> results;
...@@ -320,7 +317,6 @@ QList<CppQuickFixOperation::Ptr> DefFromDecl::match( ...@@ -320,7 +317,6 @@ QList<CppQuickFixOperation::Ptr> DefFromDecl::match(
} }
} }
} }
}
break; break;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment