[Libreoffice-commits] core.git: vcl/qt5

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Sat May 4 22:59:21 UTC 2019


 vcl/qt5/Qt5Widget.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 00221089800c29aa71079d72d81e11fc889a7054
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Sat May 4 13:58:24 2019 +0000
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Sun May 5 00:58:34 2019 +0200

    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 at fbihome.de>

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());


More information about the Libreoffice-commits mailing list