Commit cafc2a861b139c33d3989c625deb76a874159fbe

  • avatar
  • axis <qt-info @no…a.com>
  • Fri Feb 05 13:12:55 GMT 2010
Fixed a bug where text would disappear in password fields.

There were two bugs:

- First, we need to avoid triggering the CancelTransaction call when
  committing the temporary preedit text, because otherwise FEP starts
  sending us spurious backspace events. Since the
  "triggeredBySymbian" variable is no longer descriptive for that use
  case, I renamed it in the process and that changed the negation of
  the flag. Notice the absense of a change inside
  commitTemporaryPreeditString(). That is because we want that one
  to avoid the transaction cancel, and therefore wee keep the old
  negation.

- Second, m_cursorPos needs to be kept in sync with the widget state
  when we send the temporary preedit string, because the input
  context cannot separate between types of preedit text when it hits
  the first block in commitCurrentString() (types being either our
  temporary text, or FEP's text), and we have to avoid the longPress
  code path.

RevBy:    Janne Koskinen
src/gui/inputmethod/qcoefepinputcontext_p.h
(1 / 1)
  
9696 void timerEvent(QTimerEvent *timerEvent);
9797
9898private:
99 void commitCurrentString(bool triggeredBySymbian);
99 void commitCurrentString(bool cancelFepTransaction);
100100 void updateHints(bool mustUpdateInputCapabilities);
101101 void applyHints(Qt::InputMethodHints hints);
102102 void applyFormat(QList<QInputMethodEvent::Attribute> *attributes);
src/gui/inputmethod/qcoefepinputcontext_s60.cpp
(9 / 8)
  
100100
101101void QCoeFepInputContext::reset()
102102{
103 commitCurrentString(false);
103 commitCurrentString(true);
104104}
105105
106106void QCoeFepInputContext::ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateEvent aEventType)
125125
126126void QCoeFepInputContext::setFocusWidget(QWidget *w)
127127{
128 commitCurrentString(false);
128 commitCurrentString(true);
129129
130130 QInputContext::setFocusWidget(w);
131131
218218 break;
219219 case Qt::Key_Select:
220220 if (!m_preeditString.isEmpty()) {
221 commitCurrentString(false);
221 commitCurrentString(true);
222222 return true;
223223 }
224224 break;
230230 && focusWidget()->inputMethodHints() & Qt::ImhHiddenText
231231 && !keyEvent->text().isEmpty()) {
232232 // Send some temporary preedit text in order to make text visible for a moment.
233 m_cursorPos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt();
233234 m_preeditString = keyEvent->text();
234235 QList<QInputMethodEvent::Attribute> attributes;
235236 QInputMethodEvent imEvent(m_preeditString, attributes);
293293 Q_ASSERT(focusWidget());
294294
295295 if (event->type() == QEvent::MouseButtonPress && event->button() == Qt::LeftButton) {
296 commitCurrentString(false);
296 commitCurrentString(true);
297297 int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt();
298298
299299 QList<QInputMethodEvent::Attribute> attributes;
739739
740740void QCoeFepInputContext::DoCommitFepInlineEditL()
741741{
742 commitCurrentString(true);
742 commitCurrentString(false);
743743}
744744
745void QCoeFepInputContext::commitCurrentString(bool triggeredBySymbian)
745void QCoeFepInputContext::commitCurrentString(bool cancelFepTransaction)
746746{
747747 int longPress = 0;
748748
749749 if (m_preeditString.size() == 0) {
750750 QWidget *w = focusWidget();
751 if (triggeredBySymbian && w) {
751 if (!cancelFepTransaction && w) {
752752 // We must replace the last character only if the input box has already accepted one
753753 if (w->inputMethodQuery(Qt::ImCursorPosition).toInt() != m_cursorPos)
754754 longPress = 1;
765765 m_hasTempPreeditString = false;
766766 longPress = 0;
767767
768 if (!triggeredBySymbian) {
768 if (cancelFepTransaction) {
769769 CCoeFep* fep = CCoeEnv::Static()->Fep();
770770 if (fep)
771771 fep->CancelTransaction();

Comments

Add a new comment:

Login or create an account to post a comment

Add your comment