summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2021-12-06 13:42:27 +0530
committerAndras Timar <andras.timar@collabora.com>2022-01-11 11:18:09 +0100
commit5e37acbaaa0b0891829907331ecacd2d3b67526d (patch)
treeac9d88e1f9238fa8a464ef8396f119b643fbb291 /svx
parent3df583520ee03bad42df09db7dde4c0c683a228b (diff)
lokCalcRTL: shapes: do not send negative(X) invalidations
LOK client expects tile invalidations in positive document coordinates irrespective of RTL flags. For this introduce a flag mbNegativeX in svx class SdrMarkView to indicate the case when all x coordinates are negated (this happens only for the LOK + Calc + RTL mode). Use this flag to counter negate the x coordinates before sending invalidation rectangles. Change-Id: I35d8142718b538e55b668a8ee18f3dd1fe433951
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/sdrpagewindow.cxx13
-rw-r--r--svx/source/svdraw/svdmrkv.cxx9
2 files changed, 18 insertions, 4 deletions
diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx
index 8fd16e1eb02c..2a4b3b4d708b 100644
--- a/svx/source/svdraw/sdrpagewindow.cxx
+++ b/svx/source/svdraw/sdrpagewindow.cxx
@@ -428,7 +428,8 @@ void SdrPageWindow::RedrawLayer(const SdrLayerID* pId,
// Invalidate call, used from ObjectContact(OfPageView) in InvalidatePartOfView(...)
void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange)
{
- if (GetPageView().IsVisible() && GetPaintWindow().OutputToWindow())
+ bool bLOKActive = comphelper::LibreOfficeKit::isActive();
+ if (!bLOKActive && GetPageView().IsVisible() && GetPaintWindow().OutputToWindow())
{
const SvtOptionsDrawinglayer aDrawinglayerOpt;
OutputDevice& rWindow(GetPaintWindow().GetOutputDevice());
@@ -453,15 +454,19 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange)
GetPageView().GetView().InvalidateOneWin(rWindow, aVCLDiscreteRectangle);
rWindow.EnableMapMode(bWasMapModeEnabled);
}
- else if (comphelper::LibreOfficeKit::isActive())
+ else if (bLOKActive)
{
// we don't really have to have a paint window with LOK; OTOH we know
// that the drawinglayer units are 100ths of mm, so they are easy to
// convert to twips
+
+ // If the shapes use negative X coordinates, make them positive before sending
+ // the invalidation rectangle.
+ bool bNegativeX = mpImpl->mrPageView.GetView().IsNegativeX();
const tools::Rectangle aRect100thMM(
- static_cast<tools::Long>(floor(rRange.getMinX())),
+ static_cast<tools::Long>(bNegativeX ? std::max(0.0, ceil(-rRange.getMaxX())) : floor(rRange.getMinX())),
static_cast<tools::Long>(floor(rRange.getMinY())),
- static_cast<tools::Long>(ceil(rRange.getMaxX())),
+ static_cast<tools::Long>(bNegativeX ? std::max(0.0, floor(-rRange.getMinX())) : ceil(rRange.getMaxX())),
static_cast<tools::Long>(ceil(rRange.getMaxY())));
const tools::Rectangle aRectTwips = OutputDevice::LogicToLogic(aRect100thMM, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index ba6a8d586d69..57ab32e44f81 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -177,6 +177,7 @@ SdrMarkView::SdrMarkView(SdrModel& rSdrModel, OutputDevice* pOut)
, mbMrkPntDirty(false)
, mbMarkedPointsRectsDirty(false)
, mbMarkHandlesHidden(false)
+ , mbNegativeX(false)
{
BrkMarkObj();
@@ -264,6 +265,14 @@ void SdrMarkView::ModelHasChanged()
}
pResultSelection = &aSelection;
+
+ if (mbNegativeX)
+ {
+ // Convert to positive X doc-coordinates
+ tools::Long nTmp = aSelection.Left();
+ aSelection.SetLeft(-aSelection.Right());
+ aSelection.SetRight(-nTmp);
+ }
}
if(SfxViewShell* pViewShell = GetSfxViewShell())