From 708bbde16d74a1d4f51242002ac82999d0045f97 Mon Sep 17 00:00:00 2001 From: Aapo Haapanen Date: Fri, 24 Feb 2012 16:31:09 +0200 Subject: Fix backspace on empty lines with custom QML editors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Murray Read Reviewed-by: Pasi Pentikäinen --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 50039f7..62553d8 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, -- cgit v0.12