From 1ecd2d460896959cf3c5654f4cef7e4d3c8f5cf6 Mon Sep 17 00:00:00 2001 From: axis Date: Thu, 9 Sep 2010 13:48:58 +0200 Subject: Fixed crash in input methods when using symbols menu and numbers only When inputting only numbers, the symbol menu should not do anything. However in the old code the resource id of the symbol table was still being set, so the symbol key on N97 would look up a table that was not valid for the current input mode and crash. Fixed by setting the symbol table id to zero under those conditions. RevBy: Sami Merila Task: QTBUG-13472 AutoTest: Included (cherry picked from commit 5cef786a651c675d3428060a19bfd9d9ecee6083) --- tests/auto/qinputcontext/tst_qinputcontext.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qinputcontext/tst_qinputcontext.cpp b/tests/auto/qinputcontext/tst_qinputcontext.cpp index 8eef2cc794..26b7b00043 100644 --- a/tests/auto/qinputcontext/tst_qinputcontext.cpp +++ b/tests/auto/qinputcontext/tst_qinputcontext.cpp @@ -882,6 +882,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 } -- cgit v1.2.1