sc/source/ui/view/gridwin4.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 5a0839e60ac75869ad49685ca74ad6c6b49ef925
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Wed Apr 20 08:14:39 2022 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Wed Jul 13 17:05:07 2022 +0200

    sc: lok: fix offset edit output area
    
    When focus is received, the edit view output area
    rectangle is calculated to draw the text, after
    EditGrowX and EditGrowY checks, so intercept the
    rectangle to not alter the text positions.
    
    Change-Id: I1439fc3d436bd5f4d03b13bd6bb56a85012a2655
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133214
    Reviewed-by: Ashod Nakashian <a...@collabora.com>
    (cherry picked from commit 037ec953d230aef045034b59d8315e6c41dc6687)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136916
    Tested-by: Jenkins
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137028

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index e51feeda0645..3f7c08f401bd 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1271,7 +1271,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
             // So they need to be in the same coordinates/units. This is tied 
to the mapmode of the gridwin
             // attached to the EditView, so we have to change its mapmode too 
(temporarily). We save the
             // original mapmode and 'output area' and roll them back when we 
finish painting to rDevice.
-            const tools::Rectangle 
aOrigOutputArea(pEditView->GetOutputArea()); // Not in pixels.
             const MapMode aOrigMapMode = GetMapMode();
             SetMapMode(rDevice.GetMapMode());
 
@@ -1280,8 +1279,9 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
             // cursor-messaging done in the non print-twips mode)
             SuppressEditViewMessagesGuard aGuard(*pEditView);
 
-            pEditView->SetOutputArea(rDevice.PixelToLogic(aEditRect));
-            pEditView->Paint(rDevice.PixelToLogic(aEditRect), &rDevice);
+            aEditRect = rDevice.PixelToLogic(aEditRect);
+            aEditRect.Intersection(pEditView->GetOutputArea());
+            pEditView->Paint(aEditRect, &rDevice);
 
             // EditView will do the cursor notifications correctly if we're in
             // print-twips messaging mode.
@@ -1311,7 +1311,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
 
             // Rollback the mapmode and 'output area'.
             SetMapMode(aOrigMapMode);
-            pEditView->SetOutputArea(aOrigOutputArea);
         }
         else
         {

Reply via email to