Kaydet (Commit) 00221089 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

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: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst acbab790
......@@ -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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment