diff options
author | axis <qt-info@nokia.com> | 2010-12-10 14:35:06 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-12-14 09:15:02 (GMT) |
commit | 6aa1ab84404c92f2048270b1932fa10cecdcc58d (patch) | |
tree | 4a54c7415a5f2ba4081a4179fd1fcbdc51502e7d /src/gui/inputmethod | |
parent | 725716bcf158988ac664da8f8bcd2d9a8e91a916 (diff) | |
download | Qt-6aa1ab84404c92f2048270b1932fa10cecdcc58d.zip Qt-6aa1ab84404c92f2048270b1932fa10cecdcc58d.tar.gz Qt-6aa1ab84404c92f2048270b1932fa10cecdcc58d.tar.bz2 |
Fixed a bug in the input methods on S60 with QGraphicsWebView.
The bug happened because we did not expect to receive a call to
CancelFepInlineEdit() when the widget had not previously been given
any preedit text by S60. However, this can happen, and if it happens
at the same time that there is a temporarily visible character in the
widget (because it will be obscured as a password a second later),
then the temporary character would be discarded.
Fixed by checking in the beginning of CancelFepInlineEdit() whether
we currently have any temporary preedit text or not, and if we do, we
don't clear the contents, since it is the input context itself that
generated the preedit text, not S60.
Also made sure that the temporary preedit text is committed if we
receive a call to UpdateFepInlineTextL(), which may sometimes happen
without a call to StartFepInlineEditL().
Task: QT-4314
AutoTest: Included
RevBy: Shane Kearns
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 4a1b9b9..686f388 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -657,6 +657,8 @@ void QCoeFepInputContext::UpdateFepInlineTextL(const TDesC& aNewInlineText, if (!w) return; + commitTemporaryPreeditString(); + m_inlinePosition = aPositionOfInsertionPointInInlineText; QList<QInputMethodEvent::Attribute> attributes; @@ -694,6 +696,12 @@ void QCoeFepInputContext::SetInlineEditingCursorVisibilityL(TBool aCursorVisibil void QCoeFepInputContext::CancelFepInlineEdit() { + // We are not supposed to ever have a tempPreeditString and a real preedit string + // from S60 at the same time, so it should be safe to rely on this test to determine + // whether we should honor S60's request to clear the text or not. + if (m_hasTempPreeditString) + return; + QList<QInputMethodEvent::Attribute> attributes; QInputMethodEvent event(QLatin1String(""), attributes); event.setCommitString(QLatin1String(""), 0, 0); |