sc/source/ui/unoobj/docuno.cxx | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-)
New commits: commit 84cfc755828ae2c552f7edee221c2b5610c1d4db Author: Henry Castro <hcas...@collabora.com> AuthorDate: Wed Jun 23 08:50:46 2021 -0400 Commit: Henry Castro <hcas...@collabora.com> CommitDate: Fri Feb 18 18:58:45 2022 +0100 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 <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117733 Tested-by: Jenkins Reviewed-by: Henry Castro <hcas...@collabora.com> 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)