From 7ba2c87354d97448fc2b6f5ca0eea6ce0eeefb8a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 28 Aug 2024 21:11:53 +0100 Subject: Resolves: tdf#162651 area under removed editview needs to be refreshed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit which has become a problem since: commit 6d71c21890c908225945f0fc3566255ed150f660 CommitDate: Mon Jan 22 20:47:16 2024 +0100 don't always invalidate the entire width of the calc window Change-Id: Ic0db4932091806c79fd9e773d7be35727560a1ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172552 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sc/source/ui/view/tabview3.cxx | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'sc/source/ui/view') diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 40bda51d7b58..dd4495653d5b 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -2297,9 +2297,10 @@ void ScTabView::KillEditView( bool bNoPaint ) pGridWin[i]->SetMapMode(pGridWin[i]->GetDrawMapMode()); + const tools::Rectangle& rInvRect = aRectangle[i]; + if (comphelper::LibreOfficeKit::isActive()) { - const tools::Rectangle& rInvRect = aRectangle[i]; pGridWin[i]->LogicInvalidatePart(&rInvRect, nTab); // invalidate other views @@ -2316,10 +2317,26 @@ void ScTabView::KillEditView( bool bNoPaint ) SfxLokHelper::forEachOtherView(GetViewData().GetViewShell(), lInvalidateWindows); } // #i73567# the cell still has to be repainted - else if (bExtended || ( bAtCursor && !bNoPaint )) + else { - pGridWin[i]->Draw( nCol1, nRow1, nCol2, nRow2, ScUpdateMode::All ); - pGridWin[i]->UpdateSelectionOverlay(); + const bool bDoPaint = bExtended || (bAtCursor && !bNoPaint); + const bool bDoInvalidate = !bDoPaint && bAtCursor; + if (bDoPaint) + { + pGridWin[i]->Draw( nCol1, nRow1, nCol2, nRow2, ScUpdateMode::All ); + pGridWin[i]->UpdateSelectionOverlay(); + } + else if (bDoInvalidate) + { + // tdf#162651 even if !bNoPaint is set, and there will be a + // follow up Draw of the next content, the area blanked out + // by the editview which is being removed still needs to be + // invalidated. The follow-up Draw of the content may be + // optimized to only redraw the area of cells where content + // has changed and will be unaware of what bounds this + // editview grew to during its editing cycle. + pGridWin[i]->Invalidate(rInvRect); + } } } } -- cgit