Workaround for Samsung keyboard bug

Return null string instead of empty string when the selection is
empty. It looks like Samsung just tests for selection == null when
doing backspace.

Task-number: QTBUG-45785
Change-Id: Id26ce707130777fcd0ab1a4cff08367bb2810f2f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
bb10
Paul Olav Tvete 2015-05-19 16:07:42 +02:00
parent b6634023fa
commit e2102752ba
1 changed files with 2 additions and 0 deletions

View File

@ -176,6 +176,8 @@ static jstring getSelectedText(JNIEnv *env, jobject /*thiz*/, jint flags)
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
qDebug() << "@@@ GETSEL" << text;
#endif
if (text.isEmpty())
return 0;
return env->NewString(reinterpret_cast<const jchar *>(text.constData()), jsize(text.length()));
}