From 5195c26208e9e2d80509c8308d590da2ef8a029b Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Fri, 21 Oct 2011 14:40:28 +0300 Subject: Regression caused by 2be143ebb5246bb2f9b674bb09d23df5b2b6c504 After 2be143ebb5246bb2f9b674bb09d23df5b2b6c504, if user opts to spell a word him/herself instead of using the suggested word list, the result is incorrect. The existing preedit string is committed, then cursor is moved to the beginning and user written word is added. E.g. user writes 'tadaa' then selects to spell it again and writes 'radar', in editor there is 'radartadaa'. Regression is caused due to storing the cursor pointer even in cases where there is no stored preedit string. Task-number: QTBUG-22147 Reviewed-by: Miikka Heikkinen --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 66ab4c8..eeec04b 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -164,7 +164,7 @@ void QCoeFepInputContext::reset() // text. if (m_cachedPreeditString.isEmpty() && !(currentHints & Qt::ImhNoPredictiveText)) { m_cachedPreeditString = m_preeditString; - if (focusWidget()) { + if (focusWidget() && !m_cachedPreeditString.isEmpty()) { int cursor = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt(); int anchor = focusWidget()->inputMethodQuery(Qt::ImAnchorPosition).toInt(); if (cursor == anchor) -- cgit v0.12