sc/source/core/data/column3.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit e24430486f9c584fb687fe6897807d6cb9f1f217
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Sep 14 10:59:43 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Sep 15 09:46:42 2020 +0200

    DetachFormulaCellsHandler never passed a null ScDocument*
    
    Change-Id: I7974fbfe832bbb20a1aab868826611a0f7a05698
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102664
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

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);
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to