diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2018-02-23 02:58:59 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2018-02-27 19:43:32 +0530 |
commit | fa80f03899a4c28b6abf0b4fa65e8e5c5e312b91 (patch) | |
tree | 2e225d3f15bd72bee502a81c01ec298d0381573f /sc | |
parent | 0a1a3a64823c0509c4b5f1edc6ee51ca991d3501 (diff) |
lokdialog sc: post key events to the main thread
This also fixes the problem when some dialog is executed inside the key
handler.
Change-Id: I831ed4b886c1a5eac13dffd8e881a07045458e44
Reviewed-on: https://gerrit.libreoffice.org/50244
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/tiledrendering/tiledrendering.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index e70d4f17b3f7..7ac4f6121d89 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -1599,6 +1599,7 @@ void ScTiledRenderingTest::testIMESupport() // commit the string to the cell pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN); pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN); + Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT_EQUAL(aInputs[aInputs.size() - 1], pDoc->GetString(ScAddress(0, 0, 0))); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 9ba07778b89b..5fb2b88cad65 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -609,14 +609,16 @@ void ScModelObj::postKeyEvent(int nType, int nCharCode, int nKeyCode) if (!pWindow) return; + if (!pWindow->HasFocus()) + pWindow->GrabFocus(); KeyEvent aEvent(nCharCode, nKeyCode, 0); switch (nType) { case LOK_KEYEVENT_KEYINPUT: - pWindow->KeyInput(aEvent); + Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, pWindow, &aEvent); break; case LOK_KEYEVENT_KEYUP: - pWindow->KeyUp(aEvent); + Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, pWindow, &aEvent); break; default: assert(false); |