summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2022-03-07 12:17:07 +0530
committerAron Budea <aron.budea@collabora.com>2022-11-12 15:22:46 +0100
commit47c14906d0cc0fe0a193ef0a6a87e4b26110a01f (patch)
treec989a05caaa77d1b91b6470a7d935366377a833c
parent2f5b91c4fd99dd13dacfc9ee675ddd2f32cf7b8c (diff)
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 <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142610 Reviewed-by: Aron Budea <aron.budea@collabora.com>
-rw-r--r--chart2/source/controller/main/ChartController.cxx15
-rw-r--r--svx/source/svdraw/svdmrkv.cxx8
2 files changed, 23 insertions, 0 deletions
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());