diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-10 12:32:56 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-10 12:32:56 (GMT) |
commit | 72cc21e597f2d77ea1be3c1a3f7df36d8909d2fc (patch) | |
tree | e2924d64a60197f0140db53319fa1dc46a76f809 | |
parent | 5e98551d3ccf3587b5ce738f38a54df1af6df9fb (diff) | |
parent | 58c01e23ea156369b7a8b31f34e3bd9b683a22a0 (diff) | |
download | Qt-72cc21e597f2d77ea1be3c1a3f7df36d8909d2fc.zip Qt-72cc21e597f2d77ea1be3c1a3f7df36d8909d2fc.tar.gz Qt-72cc21e597f2d77ea1be3c1a3f7df36d8909d2fc.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Fixed crash in input methods when using symbols menu and numbers only
Fixed crash in input methods when using symbols menu and numbers only
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 11 | ||||
-rw-r--r-- | tests/auto/qinputcontext/tst_qinputcontext.cpp | 21 |
2 files changed, 28 insertions, 4 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index b08b9a9..af86d77 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -382,6 +382,9 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) const bool anytextmodes = hints & (ImhUppercaseOnly | ImhLowercaseOnly | ImhEmailCharactersOnly | ImhUrlCharactersOnly); const bool numbersOnly = anynumbermodes && !anytextmodes; const bool noOnlys = !(hints & ImhExclusiveInputMask); + // if alphanumeric input, or if multiple incompatible number modes are selected; + // then make all symbols available in numeric mode too. + const bool needsCharMap= !numbersOnly || ((hints & ImhFormattedNumbersOnly) && (hints & ImhDialableCharactersOnly)); TInt flags; Qt::InputMethodHints oldHints = hints; @@ -481,9 +484,7 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) if (hints & ImhNoPredictiveText || hints & ImhHiddenText) { flags |= EAknEditorFlagNoT9; } - // if alphanumeric input, or if multiple incompatible number modes are selected; - // then make all symbols available in numeric mode too. - if (!numbersOnly || ((hints & ImhFormattedNumbersOnly) && (hints & ImhDialableCharactersOnly))) + if (needsCharMap) flags |= EAknEditorFlagUseSCTNumericCharmap; m_fepState->SetFlags(flags); ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateFlagsUpdate); @@ -508,8 +509,10 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG); } else if (hints & ImhEmailCharactersOnly) { m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_EMAIL_ADDR_SPECIAL_CHARACTER_TABLE_DIALOG); - } else { + } else if (needsCharMap) { m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG); + } else { + m_fepState->SetSpecialCharacterTableResourceId(0); } if (hints & ImhHiddenText) { diff --git a/tests/auto/qinputcontext/tst_qinputcontext.cpp b/tests/auto/qinputcontext/tst_qinputcontext.cpp index 52e655b..d077bc1 100644 --- a/tests/auto/qinputcontext/tst_qinputcontext.cpp +++ b/tests/auto/qinputcontext/tst_qinputcontext.cpp @@ -884,6 +884,27 @@ void tst_QInputContext::symbianTestCoeFepInputContext_data() << QString("44") << QString(""); events.clear(); + + // Test that the symbol key successfully does nothing when in number-only mode. + events << FepReplayEvent(EEventKeyDown, EStdKeyLeftFunc, 0, 0, 0); + events << FepReplayEvent(EEventKeyUp, EStdKeyLeftFunc, 0, 0, 0); + QTest::newRow("Dead symbols key") + << true + << Qt::InputMethodHints(Qt::ImhDigitsOnly) + << 0 + << QLineEdit::Normal + << events + << QString("") + << QString(""); + QTest::newRow("Dead symbols key and password") + << true + << Qt::InputMethodHints(Qt::ImhDigitsOnly) + << 0 + << QLineEdit::Password + << events + << QString("") + << QString(""); + events.clear(); #endif } |