diff options
author | Henry Castro <hcastro@collabora.com> | 2022-04-20 08:14:39 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2022-07-08 15:30:25 +0200 |
commit | 037ec953d230aef045034b59d8315e6c41dc6687 (patch) | |
tree | 76e7123297779abe93d76b0a27ff2256a5c098b3 /sc | |
parent | 49b8b4c2caefa9428d86ee0c6bb78a151e10d292 (diff) |
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 <hcastro@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133214
Reviewed-by: Ashod Nakashian <ash@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 0c697bf085ef..481237edba9e 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1252,7 +1252,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()); @@ -1261,8 +1260,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. @@ -1292,7 +1292,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI // Rollback the mapmode and 'output area'. SetMapMode(aOrigMapMode); - pEditView->SetOutputArea(aOrigOutputArea); } else { |