diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/inc/edtwin.hxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 34 |
2 files changed, 21 insertions, 19 deletions
diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx index 2956783d1a7c..71e3f9a7b34d 100644 --- a/sw/source/uibase/inc/edtwin.hxx +++ b/sw/source/uibase/inc/edtwin.hxx @@ -284,11 +284,11 @@ public: /// @see OutputDevice::LogicInvalidate(). void LogicInvalidate(const tools::Rectangle* pRectangle) override; /// Same as MouseButtonDown(), but coordinates are in logic unit. - void LogicMouseButtonDown(const MouseEvent& rMouseEvent); + virtual void LogicMouseButtonDown(const MouseEvent& rMouseEvent) override; /// Same as MouseButtonUp(), but coordinates are in logic unit. - void LogicMouseButtonUp(const MouseEvent& rMouseEvent); + virtual void LogicMouseButtonUp(const MouseEvent& rMouseEvent) override; /// Same as MouseMove(), but coordinates are in logic unit. - void LogicMouseMove(const MouseEvent& rMouseEvent); + virtual void LogicMouseMove(const MouseEvent& rMouseEvent) override; /// Allows adjusting the point or mark of the selection to a document coordinate. void SetCursorTwipPosition(const Point& rPosition, bool bPoint, bool bClearMark); /// Allows starting or ending a graphic move or resize action. diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 39c9ad4a4ad7..ef3ed6b4d431 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3489,19 +3489,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) @@ -3529,30 +3532,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) |