diff --git a/src/plugins/cppeditor/cppinsertdecldef.cpp b/src/plugins/cppeditor/cppinsertdecldef.cpp index a5676d2a103..5ea7e3e696a 100644 --- a/src/plugins/cppeditor/cppinsertdecldef.cpp +++ b/src/plugins/cppeditor/cppinsertdecldef.cpp @@ -293,7 +293,6 @@ QList DefFromDecl::match( const QSharedPointer &interface) { const QList &path = interface->path(); - CppRefactoringFilePtr file = interface->currentFile(); int idx = path.size() - 1; for (; idx >= 0; --idx) { @@ -306,17 +305,14 @@ QList DefFromDecl::match( && !decl->type()->asFunctionType()->isPureVirtual() && decl->enclosingScope() && decl->enclosingScope()->isClass()) { - DeclaratorAST *declarator = simpleDecl->declarator_list->value; - if (file->isCursorOn(declarator->core_declarator)) { - CppRefactoringChanges refactoring(interface->snapshot()); - InsertionPointLocator locator(refactoring); - QList results; - foreach (const InsertionLocation &loc, locator.methodDefinition(decl)) { - if (loc.isValid()) - results.append(CppQuickFixOperation::Ptr(new InsertDefOperation(interface, idx, decl, loc))); - } - return results; + CppRefactoringChanges refactoring(interface->snapshot()); + InsertionPointLocator locator(refactoring); + QList results; + foreach (const InsertionLocation &loc, locator.methodDefinition(decl)) { + if (loc.isValid()) + results.append(CppQuickFixOperation::Ptr(new InsertDefOperation(interface, idx, decl, loc))); } + return results; } } }