[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sc/source

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 8 10:50:25 UTC 2021


 sc/source/ui/unoobj/docuno.cxx |   27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

New commits:
commit ef29f8c57dbb73ee3bd2e09ea557b86bf3eacfa6
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Wed Jun 23 08:50:46 2021 -0400
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Oct 8 12:49:49 2021 +0200

    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 at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

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)


More information about the Libreoffice-commits mailing list