summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAapo Haapanen <ext-aapo.haapanen@nokia.com>2012-02-24 16:31:09 +0200
committerPasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>2012-02-27 10:15:50 +0100
commitac91ce5bf2905f5f045182368d07a5361619a78e (patch)
tree7830e4b9f17f163f0dcde28cb570802d5945f0a2
parent21b60437649498c3097ab7dfa4044b15f240899b (diff)
downloadqt4-tools-ac91ce5bf2905f5f045182368d07a5361619a78e.tar.gz
Fix backspace on empty lines with custom QML editors
Symbian AknFEP doesn't return backspace keypresses to the editor if the editor is empty. This causes problems for multiline editors, because AknFEP can only see one line at a time. This issue has been previously fixed by change a2709ef3f4410a1d1755e00353e6f969f8bb5613 so that QCoeFepInputContext::DocumentLengthForFep returns lenght as 1 for empty lines. The fix was then refined by change 0ffd7fcc78e27f9184a6f1ee5a8a9cc5e6266998 so that the length is altered only when the editor has multiple lines. After the latest change, if a custom QML editor didn't have a lineCount property, the code assumed it has only one line. This caused problems for some custom multiline editors. This change alters the behaviour so that if the code can't get the linecount from the editor, it assumes it has multiple lines. This reverts the code to behave like before change 0ffd7fcc78e27f9184a6f1ee5a8a9cc5e6266998 for such custom QML editors. Task-number: ou1cimx1#981078 Change-Id: I3551d1d3ca1984957465f894c8bc237544224468 Reviewed-by: Jaakko Helanti <ext-jaakko.helanti@nokia.com> Reviewed-by: Murray Read <ext-murray.2.read@nokia.com> Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com> (cherry picked from commit 708bbde16d74a1d4f51242002ac82999d0045f97)
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 03179aa5f6..745af894cc 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -1551,7 +1551,10 @@ TInt QCoeFepInputContext::DocumentLengthForFep() const
if (lineVariant.isValid()) {
lineCount = lineVariant.toInt();
} else {
- lineCount = 1;
+ // If we can't get linecount from a custom QML editor, assume that it
+ // has multiple lines, so that it can receive backspaces also when
+ // the current line is empty.
+ lineCount = 2;
}
}
// To fix an issue with backspaces not being generated if document size is zero,