summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2021-01-08 18:26:38 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-01-14 08:35:36 +0100
commit6bb252e26ce1aeb3949c64ec6f0bef502a6a459d (patch)
treedad6c988a604343b11c5df78307c3079796b2870
parentbb1ad6209de5433fc9f5848539d937f14cc215ce (diff)
tdf#137083 consider negative width in DrawPageViewGrid
SdrPageView::DrawPageViewGrid is called too for a ScDrawPage of a RTL-sheet. In that case both the width of the SdrPage and the left edge of the passed rectangle are negative. The x-values for drawing the grid were wrong and a right-to-left sheet did not show the grid. The patch adds a case distinction with correct x-values for case RTL. Change-Id: I6d0c15bf7bbe8aff6ab2e72a440ba81f2e0e2281 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108989 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de> (cherry picked from commit 7635a475130a0e9e3b0dded853348659d07a00d7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109119 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--svx/source/svdraw/svdpagv.cxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index 0db7711890e0..c793d453734f 100644
--- a/svx/source/svdraw/svdpagv.cxx
+++ b/svx/source/svdraw/svdpagv.cxx
@@ -439,10 +439,20 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const tools::Rectangle& r
tools::Long nWrX=0;
tools::Long nWrY=0;
Point aOrg(aPgOrg);
- tools::Long x1=GetPage()->GetLeftBorder()+1+nWrX;
- tools::Long x2=GetPage()->GetWidth()-GetPage()->GetRightBorder()-1+nWrY;
- tools::Long y1=GetPage()->GetUpperBorder()+1+nWrX;
- tools::Long y2=GetPage()->GetHeight()-GetPage()->GetLowerBorder()-1+nWrY;
+ tools::Long x1 = 0;
+ tools::Long x2 = 0;
+ if (GetPage()->GetWidth() < 0) // ScDrawPage of RTL sheet
+ {
+ x1 = GetPage()->GetWidth() + GetPage()->GetLeftBorder() + 1;
+ x2 = - GetPage()->GetRightBorder() - 1;
+ }
+ else
+ {
+ x1 = GetPage()->GetLeftBorder() + 1;
+ x2 = GetPage()->GetWidth() - GetPage()->GetRightBorder() - 1;
+ }
+ tools::Long y1 = GetPage()->GetUpperBorder() + 1;
+ tools::Long y2 = GetPage()->GetHeight() - GetPage()->GetLowerBorder() - 1;
const SdrPageGridFrameList* pFrames=GetPage()->GetGridFrameList(this,nullptr);
sal_uInt16 nGridPaintCnt=1;