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: Iaa006a8ffe52b2704c7348646dde9ca4e1f78c5c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
bb10
Paul Olav Tvete 2015-05-19 16:07:42 +02:00
parent 189280026f
commit 938f9fc0f8
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()));
}