summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-06-05 11:10:31 (GMT)
committeraxis <qt-info@nokia.com>2009-06-05 11:11:31 (GMT)
commit72c003655c2009279d7360acce88d536122c8795 (patch)
tree198a5d501926f22a775b98988192e0a0dd811014 /src
parentc2fe2efd1ee04a02858b7551fad07009d763f960 (diff)
downloadQt-72c003655c2009279d7360acce88d536122c8795.zip
Qt-72c003655c2009279d7360acce88d536122c8795.tar.gz
Qt-72c003655c2009279d7360acce88d536122c8795.tar.bz2
Made Selection updates relative to the block.
Otherwise the update would always end up with the selection being in the first block.
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qtextcontrol.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 6647558..69e1ee4 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1841,8 +1841,9 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
const QInputMethodEvent::Attribute &a = e->attributes().at(i);
if (a.type == QInputMethodEvent::Selection) {
QTextCursor oldCursor = cursor;
- cursor.setPosition(a.start, QTextCursor::MoveAnchor);
- cursor.setPosition(a.start + a.length, QTextCursor::KeepAnchor);
+ int blockStart = a.start + cursor.block().position();
+ cursor.setPosition(blockStart, QTextCursor::MoveAnchor);
+ cursor.setPosition(blockStart + a.length, QTextCursor::KeepAnchor);
q->ensureCursorVisible();
repaintOldAndNewSelection(oldCursor);
}