From e19a919c69cb2ebf5f0e00ae13872bdc45c20f49 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 19 Dec 2023 15:37:08 +0000 Subject: split ScGridWindow::UpdateFormulas into two parts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit a) figures out what might need to redraw b) triggers redraws on that Change-Id: Ib6e1d8d0785cc629fd2cfb0cfdc4ad43897fd4f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161012 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sc/source/ui/inc/gridwin.hxx | 2 ++ sc/source/ui/view/gridwin.cxx | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'sc') diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index b86331d6f96e..f7a64cafb86b 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -321,6 +321,8 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::DocWindow, public DropTarget void SetupInitialPageBreaks(const ScDocument& rDoc, SCTAB nTab); DECL_DLLPRIVATE_LINK(InitiatePageBreaksTimer, Timer*, void); + void UpdateFormulaRange(SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2); + protected: virtual void PrePaint(vcl::RenderContext& rRenderContext) override; virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index cdba90d8d436..5b8e03bcf467 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5090,6 +5090,7 @@ void ScGridWindow::UpdateFormulas(SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2) if ( comphelper::LibreOfficeKit::isActive() ) { ScTabViewShell* pViewShell = mrViewData.GetViewShell(); + if (nX1 < 0) nX1 = pViewShell->GetLOKStartHeaderCol() + 1; if (nY1 < 0) @@ -5109,6 +5110,11 @@ void ScGridWindow::UpdateFormulas(SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2) nY2 = nY1 + mrViewData.VisibleCellsY( eVWhich ); } + UpdateFormulaRange(nX1, nY1, nX2, nY2); +} + +void ScGridWindow::UpdateFormulaRange(SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2) +{ if (nX2 < nX1) nX2 = nX1; if (nY2 < nY1) nY2 = nY1; -- cgit