summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2021-06-23 08:50:46 -0400
committerSzymon Kłos <szymon.klos@collabora.com>2021-10-08 12:49:49 +0200
commitef29f8c57dbb73ee3bd2e09ea557b86bf3eacfa6 (patch)
tree998c8371c97bca77964d3355a3f8003cbc6e0f82 /sc/source
parentedb3138038cb3c4558a94538e7b881cc6e2b8b4f (diff)
lok: sc: update ScModelObj::postMouseEvent
It is intended to process the drag & drop functionality in Calc. Change-Id: I501cd94e309dabf8472e5c5aa9661e7273cd0dae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118879 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/unoobj/docuno.cxx27
1 files changed, 22 insertions, 5 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 2b22929fa25d..dd363a4e1713 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -753,11 +753,28 @@ void ScModelObj::postMouseEvent(int nType, int nX, int nY, int nCount, int nButt
return;
// Calc operates in pixels...
- const Point aPosition(nX * pViewData->GetPPTX(), nY * pViewData->GetPPTY());
- LokMouseEventData aMouseEventData(nType, aPosition, nCount, MouseEventModifiers::SIMPLECLICK,
- nButtons, nModifier);
- aMouseEventData.maLogicPosition = aPointHMM;
- SfxLokHelper::postMouseEventAsync(pGridWindow, aMouseEventData);
+ const Point aPosition(nX * pViewData->GetPPTX() + pGridWindow->GetOutOffXPixel(),
+ nY * pViewData->GetPPTY() + pGridWindow->GetOutOffYPixel());
+
+ VclEventId aEvent = VclEventId::NONE;
+ MouseEvent aData(aPosition, nCount, MouseEventModifiers::SIMPLECLICK, nButtons, nModifier);
+ aData.setLogicPosition(aPointHMM);
+ switch (nType)
+ {
+ case LOK_MOUSEEVENT_MOUSEBUTTONDOWN:
+ aEvent = VclEventId::WindowMouseButtonDown;
+ break;
+ case LOK_MOUSEEVENT_MOUSEBUTTONUP:
+ aEvent = VclEventId::WindowMouseButtonUp;
+ break;
+ case LOK_MOUSEEVENT_MOUSEMOVE:
+ aEvent = VclEventId::WindowMouseMove;
+ break;
+ default:
+ break;
+ }
+
+ Application::LOKHandleMouseEvent(aEvent, pGridWindow, &aData);
}
void ScModelObj::setTextSelection(int nType, int nX, int nY)