diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-03-11 08:21:15 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-03-11 08:21:15 (GMT) |
commit | 327c36acdba0422e93d99dc71cb3f5238d326977 (patch) | |
tree | d85c7b186af9a9324bb4acc5e36d630966876fee /src/gui/inputmethod | |
parent | b9f8c1491550fe671d1809481ad7f70737034a3b (diff) | |
parent | 16e8cc808ae7087aadd95855c97d715941711b45 (diff) | |
download | Qt-327c36acdba0422e93d99dc71cb3f5238d326977.zip Qt-327c36acdba0422e93d99dc71cb3f5238d326977.tar.gz Qt-327c36acdba0422e93d99dc71cb3f5238d326977.tar.bz2 |
Merge remote branch 'origin/4.7' into 4.7-lighthouse
Conflicts:
src/gui/kernel/qapplication.cpp
src/gui/kernel/qapplication_p.h
src/gui/kernel/qwidget.cpp
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 1ac8ace..cc60246 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -551,6 +551,21 @@ void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText, m_formatRetriever = &aInlineTextFormatRetriever; m_pointerHandler = &aPointerEventHandlerDuringInlineEdit; + // With T9 aInitialInlineText is typically empty when StartFepInlineEditL is called, + // but FEP requires that selected text is always removed at StartFepInlineEditL. + // Let's remove the selected text if aInitialInlineText is empty and there is selected text + if (m_preeditString.isEmpty()) { + int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt(); + int replacementLength = qAbs(m_cursorPos-anchor); + if (replacementLength > 0) { + int replacementStart = m_cursorPos < anchor ? 0 : -replacementLength; + QList<QInputMethodEvent::Attribute> clearSelectionAttributes; + QInputMethodEvent clearSelectionEvent(QLatin1String(""), clearSelectionAttributes); + clearSelectionEvent.setCommitString(QLatin1String(""), replacementStart, replacementLength); + sendEvent(clearSelectionEvent); + } + } + applyFormat(&attributes); attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, |