summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/inc/gridwin.hxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx6
2 files changed, 8 insertions, 0 deletions
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;