editeng/source/editeng/impedit3.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
New commits: commit 01d9b58f29a4ab2734ad8f882798b5fc0c9d3570 Author: Andreas Heinisch <andreas.heini...@yahoo.de> AuthorDate: Mon Feb 14 18:29:03 2022 +0100 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Tue Feb 15 17:35:40 2022 +0100 tdf#143709 - Create repaint rectangle with the old text size Otherwise, the repaint rectangle uses the new text size, which may lead to visual artifacts, if the old text size exceeds the new one. Change-Id: I9b49755bf6b8c453e319e2a4081d58bf2e433cd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129920 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de> (cherry picked from commit 7c00544d672f0fc0f08c12f5fd9cd53fdbe96733) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129935 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index a0e4eb43b913..19d942eeb911 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -425,7 +425,11 @@ void ImpEditEngine::FormatDoc() tools::Long nNewHeight = CalcTextHeight(&nNewHeightNTP); tools::Long nDiff = nNewHeight - nCurTextHeight; if ( nDiff ) + { + aInvalidRect.Union(tools::Rectangle::Justify( + { 0, nNewHeight }, { getWidthDirectionAware(aPaperSize), nCurTextHeight })); aStatus.GetStatusWord() |= !IsEffectivelyVertical() ? EditStatusFlags::TextHeightChanged : EditStatusFlags::TEXTWIDTHCHANGED; + } nCurTextHeight = nNewHeight; nCurTextHeightNTP = nNewHeightNTP; @@ -450,10 +454,6 @@ void ImpEditEngine::FormatDoc() } } - if (nDiff) - aInvalidRect.Union(tools::Rectangle::Justify( - { 0, nNewHeight }, { getWidthDirectionAware(aPaperSize), nCurTextHeight })); - if (!aRepaintParas.empty()) { auto CombineRepaintParasAreas = [&](const LineAreaInfo& rInfo) {