diff --git a/src/plugins/cppeditor/cppquickfix.cpp b/src/plugins/cppeditor/cppquickfix.cpp
index f4baa73299586316dfef69f6cd5223e31a1dbe70..66591ffb2eb6b521905695b22289a49fcf94fcba 100644
--- a/src/plugins/cppeditor/cppquickfix.cpp
+++ b/src/plugins/cppeditor/cppquickfix.cpp
@@ -926,7 +926,10 @@ int CppQuickFixOperation::match(TextEditor::QuickFixState *state)
 Utils::ChangeSet::Range CppQuickFixOperation::range(unsigned tokenIndex) const
 {
     const CPlusPlus::Token &token = tokenAt(tokenIndex);
-    return Utils::ChangeSet::Range(token.begin(), token.end());
+    unsigned line, column;
+    _document->translationUnit()->getPosition(token.begin(), &line, &column);
+    const int start = editor()->document()->findBlockByNumber(line - 1).position() + column - 1;
+    return Utils::ChangeSet::Range(start, start + token.length());
 }
 
 Utils::ChangeSet::Range CppQuickFixOperation::range(CPlusPlus::AST *ast) const