summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2021-06-23 08:50:46 -0400
committerHenry Castro <hcastro@collabora.com>2022-02-18 18:58:45 +0100
commit84cfc755828ae2c552f7edee221c2b5610c1d4db (patch)
treeea7e23a413dd72d06845a18ac1a679f202406cc0 /sc
parent1afa29d1e526c4e10318a4b05767fa4333786cd4 (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117733 Tested-by: Jenkins Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'sc')
-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 14120753702a..d75d1dba666a 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -761,11 +761,28 @@ void ScModelObj::postMouseEvent(int nType, int nX, int nY, int nCount, int nButt
pGridWindow->GrabFocus();
// 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)