summaryrefslogtreecommitdiffstats
path: root/src/gui/inputmethod
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-03-11 08:21:15 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2010-03-11 08:21:15 (GMT)
commit327c36acdba0422e93d99dc71cb3f5238d326977 (patch)
treed85c7b186af9a9324bb4acc5e36d630966876fee /src/gui/inputmethod
parentb9f8c1491550fe671d1809481ad7f70737034a3b (diff)
parent16e8cc808ae7087aadd95855c97d715941711b45 (diff)
downloadQt-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.cpp15
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,