diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-12 03:04:01 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-12 03:04:01 (GMT) |
commit | a4e406277bc6af457d26134d654f17df553330fc (patch) | |
tree | 4ba940003a96ef34262ced7f072f8dbb06638ae7 /src/gui | |
parent | 7744f0d6bf5a8c4395ecf1a2bfe09c392e8d8cd1 (diff) | |
parent | 6fbfb1ab3f26ad672eb24f9b4a0ce1a8eea08298 (diff) | |
download | Qt-a4e406277bc6af457d26134d654f17df553330fc.zip Qt-a4e406277bc6af457d26134d654f17df553330fc.tar.gz Qt-a4e406277bc6af457d26134d654f17df553330fc.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Don't crash on an invalid replacementStart from an input method.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/qlinecontrol.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index 202ea7a..8d4a90e 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -435,6 +435,8 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) c += event->commitString().length() - qMin(-event->replacementStart(), event->replacementLength()); m_cursor += event->replacementStart(); + if (m_cursor < 0) + m_cursor = 0; // insert commit string if (event->replacementLength()) { @@ -447,7 +449,7 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) cursorPositionChanged = true; } - m_cursor = qMin(c, m_text.length()); + m_cursor = qBound(0, c, m_text.length()); for (int i = 0; i < event->attributes().size(); ++i) { const QInputMethodEvent::Attribute &a = event->attributes().at(i); |