summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2019-05-04 13:58:24 +0000
committerJan-Marek Glogowski <glogow@fbihome.de>2019-05-05 00:58:34 +0200
commit00221089800c29aa71079d72d81e11fc889a7054 (patch)
treef9664e0a5597fded73567555f701eca6cd2f6944 /vcl
parentacbab790126ddeea7ec6b72cffac68b9d01f756d (diff)
Qt5 IM allow committing empty strings
This is a really nasty bug, which is mainly triggered by focus change. It happens because Qt tries to delete the surrounding text on the first key press after focusing in, sending an empty commit string via QInputMethodEvent. To reproduce: * type some dummy word in Writer * select a part of the word * Alt+Tab to a different window to switch focus * Alt+Tab back to Writer * Press Alt => deletes the selected text Instead of Alt+Tab you can also switch the IM via hotkey. Change-Id: I0ce4c64aebf93a422bd3067f204da1d8f326a327 Reviewed-on: https://gerrit.libreoffice.org/71796 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qt5/Qt5Widget.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index b25d26092a83..0b22cbb884f8 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -478,7 +478,7 @@ void Qt5Widget::inputMethodEvent(QInputMethodEvent* pEvent)
aInputEvent.mpTextAttr = nullptr;
aInputEvent.mnCursorFlags = 0;
- if (!pEvent->commitString().isEmpty())
+ if (!pEvent->commitString().isNull())
{
vcl::DeletionListener aDel(m_pFrame);
aInputEvent.maText = toOUString(pEvent->commitString());