From e24430486f9c584fb687fe6897807d6cb9f1f217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 14 Sep 2020 10:59:43 +0100 Subject: [PATCH] DetachFormulaCellsHandler never passed a null ScDocument* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7974fbfe832bbb20a1aab868826611a0f7a05698 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102664 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sc/source/core/data/column3.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index f6a42fce7a72..4079fb04266c 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -380,19 +380,19 @@ public: class DetachFormulaCellsHandler { - ScDocument* mpDoc; + ScDocument& mrDoc; sc::EndListeningContext* mpCxt; public: - DetachFormulaCellsHandler( ScDocument* pDoc, sc::EndListeningContext* pCxt ) : - mpDoc(pDoc), mpCxt(pCxt) {} + DetachFormulaCellsHandler( ScDocument& rDoc, sc::EndListeningContext* pCxt ) : + mrDoc(rDoc), mpCxt(pCxt) {} void operator() (size_t /*nRow*/, ScFormulaCell* pCell) { if (mpCxt) pCell->EndListeningTo(*mpCxt); else - pCell->EndListeningTo(*mpDoc); + pCell->EndListeningTo(mrDoc); } }; @@ -459,7 +459,7 @@ void ScColumn::DetachFormulaCells( if (GetDoc()->IsClipOrUndo()) return; - DetachFormulaCellsHandler aFunc(GetDoc(), nullptr); + DetachFormulaCellsHandler aFunc(*GetDoc(), nullptr); sc::ProcessFormula(aPos.first, maCells, nRow, nNextTopRow-1, aFunc); } @@ -542,7 +542,7 @@ void ScColumn::DetachFormulaCells( sc::EndListeningContext& rCxt, SCROW nRow1, S if (GetDoc()->IsClipOrUndo()) return; - DetachFormulaCellsHandler aFunc(GetDoc(), &rCxt); + DetachFormulaCellsHandler aFunc(*GetDoc(), &rCxt); sc::ProcessFormula(it, maCells, nRow1, nRow2, aFunc); }