diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-27 16:01:16 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-27 16:01:26 (GMT) |
commit | 56c8393c5830045f599a22edbe4fd17c18dc827d (patch) | |
tree | 0bda8c988706930beab2c204a1447092a43d7741 /src/gui/text | |
parent | 71c2cfee4bcd81b2552b66b676895dcd9a6a794b (diff) | |
parent | f93097671f512f38790ba2d56bd5b1e037810266 (diff) | |
download | Qt-56c8393c5830045f599a22edbe4fd17c18dc827d.zip Qt-56c8393c5830045f599a22edbe4fd17c18dc827d.tar.gz Qt-56c8393c5830045f599a22edbe4fd17c18dc827d.tar.bz2 |
Merge commit 'upstream/4.6' into oslo-staging-2/4.6
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextcontrol.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index be79773..f96f66b 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1849,8 +1849,8 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) || e->preeditString() != cursor.block().layout()->preeditAreaText() || e->replacementLength() > 0; + cursor.beginEditBlock(); if (isGettingInput) { - cursor.beginEditBlock(); cursor.removeSelectedText(); } @@ -1876,7 +1876,8 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) QTextBlock block = cursor.block(); QTextLayout *layout = block.layout(); - layout->setPreeditArea(cursor.position() - block.position(), e->preeditString()); + if (isGettingInput) + layout->setPreeditArea(cursor.position() - block.position(), e->preeditString()); QList<QTextLayout::FormatRange> overrides; preeditCursor = e->preeditString().length(); hideCursor = false; @@ -1897,9 +1898,7 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) } } layout->setAdditionalFormats(overrides); - - if (isGettingInput) - cursor.endEditBlock(); + cursor.endEditBlock(); } QVariant QTextControl::inputMethodQuery(Qt::InputMethodQuery property) const |