summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-13 15:32:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-13 21:18:28 +0200
commit61fa9c8cbf1792fad2bdc8f86a2825f759d18950 (patch)
treef05868a3e5cd47d4be066e6f52b44e0b09d89f88
parent3e6f94da60ca9de99ca0f805a36ab2473cf30e78 (diff)
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@redhat.com>
-rw-r--r--sc/inc/formulacell.hxx2
-rw-r--r--sc/source/core/data/column.cxx2
-rw-r--r--sc/source/core/data/column4.cxx2
-rw-r--r--sc/source/core/data/formulacell.cxx6
-rw-r--r--sc/source/filter/oox/formulabuffer.cxx2
5 files changed, 7 insertions, 7 deletions
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());