sc/qa/unit/tiledrendering/tiledrendering.cxx | 1 + sc/source/ui/unoobj/docuno.cxx | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-)
New commits: commit 0178d2b7071be32ac2334e0548beae3b4e8dbc7d Author: Pranav Kant <pran...@collabora.co.uk> Date: Fri Feb 23 02:58:59 2018 +0530 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 <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 74d2d3dc5f0a..11c5179622c6 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -1590,6 +1590,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 b6cbc5e46fac..d191d14ba9a5 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -619,14 +619,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); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits