[Libreoffice-commits] core.git: sc/inc sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sun Sep 13 19:19:05 UTC 2020


 sc/inc/formulacell.hxx                 |    2 +-
 sc/source/core/data/column.cxx         |    2 +-
 sc/source/core/data/column4.cxx        |    2 +-
 sc/source/core/data/formulacell.cxx    |    6 +++---
 sc/source/filter/oox/formulabuffer.cxx |    2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 61fa9c8cbf1792fad2bdc8f86a2825f759d18950
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Sep 13 15:32:30 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Sep 13 21:18:28 2020 +0200

    ScFormulaCell ctor variant never passed a null ScDocument
    
    Change-Id: Ic96245d22c717d4360fe73855aaca9eaa1fd206d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102587
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 9f9ab5f23587..0f77f5aa72cf 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -193,7 +193,7 @@ public:
                    const formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_DEFAULT,
                    ScMatrixMode cMatInd = ScMatrixMode::NONE );
 
-    ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos, const ScFormulaCellGroupRef& xGroup,
+    ScFormulaCell( ScDocument& rDoc, const ScAddress& rPos, const ScFormulaCellGroupRef& xGroup,
                    const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT,
                    ScMatrixMode = ScMatrixMode::NONE );
 
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index e7123988262b..fec0cb3de38e 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2340,7 +2340,7 @@ class UpdateRefOnNonCopy
         aUndoPos.IncRow();
         for (SCROW i = 1; i < nLength; ++i, aUndoPos.IncRow())
         {
-            pFC = new ScFormulaCell(mpUndoDoc, aUndoPos, xGroup);
+            pFC = new ScFormulaCell(*mpUndoDoc, aUndoPos, xGroup);
             aCells.push_back(pFC);
         }
 
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index f6dac8ae3c65..e7f408175592 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -580,7 +580,7 @@ void ScColumn::CloneFormulaCell(
             xGroup->compileCode(*pDocument, aPos, pDocument->GetGrammar());
             for (size_t i = 0; i < nLen; ++i, aPos.IncRow())
             {
-                ScFormulaCell* pCell = new ScFormulaCell(pDocument, aPos, xGroup, pDocument->GetGrammar(), nMatrixFlag);
+                ScFormulaCell* pCell = new ScFormulaCell(*pDocument, aPos, xGroup, pDocument->GetGrammar(), nMatrixFlag);
                 if (nMatrixFlag == ScMatrixMode::Formula)
                     pCell->SetMatColsRows( nMatrixCols, nMatrixRows);
                 if (i == 0)
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 81279a1e4936..228150525db0 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -769,7 +769,7 @@ ScFormulaCell::ScFormulaCell(
 }
 
 ScFormulaCell::ScFormulaCell(
-    ScDocument* pDoc, const ScAddress& rPos, const ScFormulaCellGroupRef& xGroup,
+    ScDocument& rDoc, const ScAddress& rPos, const ScFormulaCellGroupRef& xGroup,
     const FormulaGrammar::Grammar eGrammar, ScMatrixMode cInd ) :
     mxGroup(xGroup),
     bDirty(true),
@@ -790,8 +790,8 @@ ScFormulaCell::ScFormulaCell(
     nSeenInIteration(0),
     nFormatType(xGroup->mnFormatType),
     eTempGrammar( eGrammar),
-    pCode(xGroup->mpCode ? xGroup->mpCode.get() : new ScTokenArray(pDoc)),
-    pDocument( pDoc ),
+    pCode(xGroup->mpCode ? xGroup->mpCode.get() : new ScTokenArray(&rDoc)),
+    pDocument( &rDoc ),
     pPrevious(nullptr),
     pNext(nullptr),
     pPreviousTrack(nullptr),
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx
index 0d1855468bf1..85cc5629c3f4 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -221,7 +221,7 @@ void applyCellFormulas(
                 }
                 ++xGroup->mnLength;
 
-                pCell = new ScFormulaCell(&rDoc.getDoc(), aPos, xGroup);
+                pCell = new ScFormulaCell(rDoc.getDoc(), aPos, xGroup);
             }
             else
                 pCell = new ScFormulaCell(&rDoc.getDoc(), aPos, p->mpCell->GetCode()->Clone());


More information about the Libreoffice-commits mailing list