sc/source/ui/view/gridwin4.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 86125f45b8cb608a5f9277fa8013f175496dfe4d
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Mon Nov 22 14:29:05 2021 +0530
Commit:     Dennis Francis <dennis.fran...@collabora.com>
CommitDate: Sat Jan 29 05:04:00 2022 +0100

    lokCalcRTL: fix editcell painting from other views as well
    
    Change-Id: Iac431996570f1f7eb091809442d8781ea60aa9b5
    (cherry picked from commit 455d4047487396c3c70d6113ac5d07deecb1d3a1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128899
    Tested-by: Jenkins
    Reviewed-by: Dennis Francis <dennis.fran...@collabora.com>

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 4ef2e92ad0fd..4f1f1cc49130 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1063,12 +1063,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 = 
-o3tl::convert(aOriginalMode.GetOrigin().X(), o3tl::Length::twip, 
o3tl::Length::px);
+                                // 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();

Reply via email to