sc/source/ui/drawfunc/fusel.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit cc827250ed249202afd97a84db13575648ed9b49
Author:     Dennis Francis <[email protected]>
AuthorDate: Thu Nov 25 17:38:14 2021 +0530
Commit:     Dennis Francis <[email protected]>
CommitDate: Wed Feb 2 10:13:00 2022 +0100

    lokCalcRTL: shape selection: negate mouse X...
    
    as in LOK RTL mode draw objects have negated document X coordinate.
    
    Change-Id: Ie4c00fc0d1aa458a0aa6dd502be227cd6f82be3e
    (cherry picked from commit d423a86b3e063da02cfdb302eaa996ca54eed9d0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129191
    Tested-by: Jenkins
    Reviewed-by: Dennis Francis <[email protected]>

diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 18ba12b792b9..46b7fc47d040 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -32,6 +32,7 @@
 #include <sfx2/app.hxx>
 #include <sfx2/ipclient.hxx>
 #include <sfx2/viewfrm.hxx>
+#include <comphelper/lok.hxx>
 
 #include <fusel.hxx>
 #include <sc.hrc>
@@ -85,6 +86,14 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
     else
         aMDPos = pWindow->PixelToLogic(rMEvt.GetPosPixel());
 
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        ScViewData& rViewData = rViewShell.GetViewData();
+        ScDocument& rDocument = rViewData.GetDocument();
+        if (rDocument.IsNegativePage(rViewData.GetTabNo()))
+            aMDPos.setX(-aMDPos.X());
+    }
+
     if ( rMEvt.IsLeft() )
     {
         SdrHdl* pHdl = pView->PickHandle(aMDPos);
@@ -351,6 +360,9 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
     ::std::vector< OUString > aExcludedChartNames;
     ScRangeListVector aProtectedChartRangesVector;
 
+    if (comphelper::LibreOfficeKit::isActive() && 
rDocument.IsNegativePage(rViewData.GetTabNo()))
+        aPnt.setX(-aPnt.X());
+
     if (pView && rMEvt.IsLeft())
     {
         if ( pView->IsDragObj() )

Reply via email to