summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uno/unotxdoc.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/uno/unotxdoc.cxx')
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx34
1 files changed, 18 insertions, 16 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index c8a9b7ec7092..a0b549b11329 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3487,19 +3487,22 @@ void SwXTextDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode)
if (!pWindow)
return;
- KeyEvent aEvent(nCharCode, nKeyCode, 0);
+ LOKAsyncEventData* pLOKEv = new LOKAsyncEventData;
+ pLOKEv->mpWindow = pWindow;
switch (nType)
{
case LOK_KEYEVENT_KEYINPUT:
- pWindow->KeyInput(aEvent);
+ pLOKEv->mnEvent = VclEventId::WindowKeyInput;
break;
case LOK_KEYEVENT_KEYUP:
- pWindow->KeyUp(aEvent);
+ pLOKEv->mnEvent = VclEventId::WindowKeyUp;
break;
default:
assert(false);
- break;
}
+
+ pLOKEv->maKeyEvent = KeyEvent(nCharCode, nKeyCode, 0);
+ Application::PostUserEvent(Link<void*, void>(pLOKEv, ITiledRenderable::LOKPostAsyncEvent));
}
void SwXTextDocument::postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
@@ -3527,30 +3530,29 @@ void SwXTextDocument::postMouseEvent(int nType, int nX, int nY, int nCount, int
}
SwEditWin& rEditWin = pDocShell->GetView()->GetEditWin();
- Point aPos(nX , nY);
- MouseEvent aEvent(aPos, nCount, MouseEventModifiers::SIMPLECLICK, nButtons, nModifier);
+
+ LOKAsyncEventData* pLOKEv = new LOKAsyncEventData;
+ pLOKEv->mpWindow = &rEditWin;
switch (nType)
{
case LOK_MOUSEEVENT_MOUSEBUTTONDOWN:
- rEditWin.LogicMouseButtonDown(aEvent);
-
- if (nButtons & MOUSE_RIGHT)
- {
- const CommandEvent aCEvt(aPos, CommandEventId::ContextMenu, true, nullptr);
- rEditWin.Command(aCEvt);
- }
+ pLOKEv->mnEvent = VclEventId::WindowMouseButtonDown;
break;
case LOK_MOUSEEVENT_MOUSEBUTTONUP:
- rEditWin.LogicMouseButtonUp(aEvent);
+ pLOKEv->mnEvent = VclEventId::WindowMouseButtonUp;
break;
case LOK_MOUSEEVENT_MOUSEMOVE:
- rEditWin.LogicMouseMove(aEvent);
+ pLOKEv->mnEvent = VclEventId::WindowMouseMove;
break;
default:
assert(false);
- break;
}
+
+ pLOKEv->maMouseEvent = MouseEvent(Point(nX, nY), nCount,
+ MouseEventModifiers::SIMPLECLICK,
+ nButtons, nModifier);
+ Application::PostUserEvent(Link<void*, void>(pLOKEv, ITiledRenderable::LOKPostAsyncEvent));
}
void SwXTextDocument::setTextSelection(int nType, int nX, int nY)