chart2/source/controller/main/ChartController.cxx |   15 +++++++++++++++
 svx/source/svdraw/svdmrkv.cxx                     |    8 ++++++++
 2 files changed, 23 insertions(+)

New commits:
commit 47c14906d0cc0fe0a193ef0a6a87e4b26110a01f
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Mon Mar 7 12:17:07 2022 +0530
Commit:     Aron Budea <aron.bu...@collabora.com>
CommitDate: Sat Nov 12 15:22:46 2022 +0100

    lokCalcRTL: chart-edit: no bounding box
    
    Fix for selections(svx-marks) similar to the fix for chart edit mode
    tile painting
    
    ```
    4fd2a14c6ee68f0574766ec7ec3dca35debe9d20
    lokCalcRTL: global RTL: fix chart edit mode rendering
    ```
    
    Change-Id: I2b5a2af7023b09254b8471b750122bec10126bde
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131091
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142610
    Reviewed-by: Aron Budea <aron.bu...@collabora.com>

diff --git a/chart2/source/controller/main/ChartController.cxx 
b/chart2/source/controller/main/ChartController.cxx
index 2e7185fdbd68..a6662e2a023e 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -64,6 +64,7 @@
 #include <com/sun/star/chart2/XChartTypeContainer.hpp>
 #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
 #include <com/sun/star/chart2/XDataProviderAccess.hpp>
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
 
 #include <sal/log.hxx>
 #include <tools/debug.hxx>
@@ -72,6 +73,7 @@
 #include <vcl/svapp.hxx>
 #include <vcl/weld.hxx>
 #include <osl/mutex.hxx>
+#include <comphelper/lok.hxx>
 
 #include <sfx2/sidebar/SidebarController.hxx>
 
@@ -716,7 +718,20 @@ void ChartController::impl_createDrawViewController()
     {
         if( m_pDrawModelWrapper )
         {
+            bool bLokCalcGlobalRTL = false;
+            if(comphelper::LibreOfficeKit::isActive() && 
AllSettings::GetLayoutRTL())
+            {
+                uno::Reference< XChartDocument > xChartDoc(getModel(), 
uno::UNO_QUERY);
+                if (xChartDoc.is())
+                {
+                    ChartModel& rModel = dynamic_cast<ChartModel&>(*xChartDoc);
+                    uno::Reference<css::sheet::XSpreadsheetDocument> 
xSSDoc(rModel.getParent(), uno::UNO_QUERY);
+                    if (xSSDoc.is())
+                        bLokCalcGlobalRTL = true;
+                }
+            }
             m_pDrawViewWrapper.reset( new 
DrawViewWrapper(m_pDrawModelWrapper->getSdrModel(),GetChartWindow()->GetOutDev())
 );
+            m_pDrawViewWrapper->SetNegativeX(bLokCalcGlobalRTL);
             m_pDrawViewWrapper->attachParentReferenceDevice( getModel() );
         }
     }
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index b788c2a060c3..f48051e974c0 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -789,6 +789,14 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
                 if (pViewShellWindow && pViewShellWindow->IsAncestorOf(*pWin))
                 {
                     Point aOffsetPx = 
pWin->GetOffsetPixelFrom(*pViewShellWindow);
+                    if (mbNegativeX && AllSettings::GetLayoutRTL())
+                    {
+                        // mbNegativeX is set only for Calc in RTL mode.
+                        // If global RTL flag is set, vcl-window X offset of 
chart window is
+                        // mirrored w.r.t parent window rectangle. This needs 
to be reverted.
+                        aOffsetPx.setX(pViewShellWindow->GetOutOffXPixel() + 
pViewShellWindow->GetSizePixel().Width()
+                            - pWin->GetOutOffXPixel() - 
pWin->GetSizePixel().Width());
+                    }
                     Point aLogicOffset = pWin->PixelToLogic(aOffsetPx);
                     addLogicOffset = aLogicOffset;
                     aSelection.Move(aLogicOffset.getX(), aLogicOffset.getY());

Reply via email to