summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2021-11-22 14:29:05 +0530
committerAndras Timar <andras.timar@collabora.com>2022-01-11 11:18:07 +0100
commit455d4047487396c3c70d6113ac5d07deecb1d3a1 (patch)
tree490a4f61e09814541f19eef3f87060167991279b
parentlokCalcRTL: edit cell painting: avoid indent... (diff)
downloadcore-455d4047487396c3c70d6113ac5d07deecb1d3a1.tar.gz
core-455d4047487396c3c70d6113ac5d07deecb1d3a1.zip
lokCalcRTL: fix editcell painting from other views as well
Change-Id: Iac431996570f1f7eb091809442d8781ea60aa9b5
-rw-r--r--sc/source/ui/view/gridwin4.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 4770c183324f..fac0f60b41a0 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1050,12 +1050,26 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
Point aStart = mrViewData.GetScrPos( nCol1, nRow1, eOtherWhich );
Point aEnd = mrViewData.GetScrPos( nCol2+1, nRow2+1, eOtherWhich );
+ if (bIsTiledRendering && bLayoutRTL)
+ {
+ // Transform the cell range X coordinates such that the edit cell area is
+ // horizontally mirrored w.r.t the (combined-)tile.
+ tools::Long nStartTileX = -aOriginalMode.GetOrigin().X() / TWIPS_PER_PIXEL;
+ // Note: nStartTileX is scaled by 2 only to offset for the addition of
+ // the -ve of the same qty (and nScrX) few lines below.
+ tools::Long nMirrorX = 2 * nStartTileX + aOutputData.GetScrW();
+ aStart.setX(nMirrorX - 1 - aStart.X());
+ aEnd.setX(nMirrorX - 1 - aEnd.X());
+ }
+
// don't overwrite grid
tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
aEnd.AdjustX( -(2 * nLayoutSign) );
aEnd.AdjustY( -2 );
tools::Rectangle aBackground(aStart, aEnd);
+ if (bIsTiledRendering && bLayoutRTL)
+ aBackground.Justify();
// Need to draw the background in absolute coords.
Point aOrigin = aOriginalMode.GetOrigin();