[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/qa sc/source
Pranav Kant
pranavk at collabora.co.uk
Fri Feb 23 19:47:11 UTC 2018
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 <pranavk at 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 <kendy at collabora.com>
Tested-by: Jan Holesovsky <kendy at 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);
More information about the Libreoffice-commits
mailing list