diff options
author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2010-06-16 17:30:20 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2010-06-16 18:03:43 +0200 |
commit | a1a565b9c55b563460be0d5ca7aef6deb93e0ed1 (patch) | |
tree | c6cfbb081295707ed88174f59389709c94c10506 /src | |
parent | e1a0f5abef4ea9c7b6fff827c054253cb65b7c40 (diff) | |
download | qt-creator-a1a565b9c55b563460be0d5ca7aef6deb93e0ed1.tar.gz |
Two more columnNumber() calls that should be positionInBlock()
columnNumber() relies on text wrapping, and we're only interested in the
position of the cursor in the block.
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/cplusplus/ASTPath.h | 2 | ||||
-rw-r--r-- | src/plugins/cpptools/cppcodecompletion.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libs/cplusplus/ASTPath.h b/src/libs/cplusplus/ASTPath.h index 84b5a2ac02..63cbb1ae6f 100644 --- a/src/libs/cplusplus/ASTPath.h +++ b/src/libs/cplusplus/ASTPath.h @@ -51,7 +51,7 @@ public: {} QList<AST *> operator()(const QTextCursor &cursor) - { return this->operator()(cursor.blockNumber(), cursor.columnNumber()); } + { return this->operator()(cursor.blockNumber(), cursor.positionInBlock()); } /// line and column are 0-based! QList<AST *> operator()(int line, int column); diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index 2ede5fca70..23de6cc446 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -640,7 +640,7 @@ bool CppCodeCompletion::triggersCompletion(TextEditor::ITextEditable *editor) if (TextEditor::BaseTextEditor *edit = qobject_cast<TextEditor::BaseTextEditor *>(editor->widget())) { QTextCursor tc(edit->document()); tc.setPosition(pos); - return tc.columnNumber() == 1; + return tc.positionInBlock() == 1; } return false; |