chart2/source/controller/main/ChartController.cxx | 15 +++++++++++++++ svx/source/svdraw/svdmrkv.cxx | 8 ++++++++ 2 files changed, 23 insertions(+)
New commits: commit 64631ddcf360102d6f72a938a154529a1edc69f7 Author: Dennis Francis <dennis.fran...@collabora.com> AuthorDate: Mon Mar 7 12:17:07 2022 +0530 Commit: Dennis Francis <dennis.fran...@collabora.com> CommitDate: Tue Mar 15 08:28: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 ``` Conflicts: chart2/source/controller/main/ChartController.cxx 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/+/131572 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.fran...@collabora.com> diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 974c36ba20e0..54e950a3b6eb 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -71,6 +71,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> @@ -79,6 +80,7 @@ #include <vcl/svapp.hxx> #include <vcl/weld.hxx> #include <osl/mutex.hxx> +#include <comphelper/lok.hxx> #include <sfx2/sidebar/SidebarController.hxx> @@ -703,7 +705,20 @@ void ChartController::impl_createDrawViewController() { if( m_pDrawModelWrapper ) { + bool bLokCalcGlobalRTL = false; + if(comphelper::LibreOfficeKit::isActive() && AllSettings::GetLayoutRTL()) + { + rtl::Reference< ChartModel > xChartModel = getChartModel(); + if (xChartModel.is()) + { + uno::Reference<css::sheet::XSpreadsheetDocument> xSSDoc(xChartModel->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( getChartModel() ); } } diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index cac8dfc2db51..e831dbc92733 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -786,6 +786,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());