summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-14 09:18:11 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-14 16:01:06 +0200
commit2e51715a44827727a11708b80d132a1c33ddcd9f (patch)
tree46657c356b20435138726275b7c3053cb622a40f
parent2912119c3d4e1af3234841748a41187efe9d0e0d (diff)
ScRefUpdate::UpdateTranspose never passed a null ScDocument*
Change-Id: Ibb565e2e2f253f9c7d53519d29930344249cf474 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102633 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/core/data/formulacell.cxx2
-rw-r--r--sc/source/core/inc/refupdat.hxx2
-rw-r--r--sc/source/core/tool/rangenam.cxx2
-rw-r--r--sc/source/core/tool/refupdat.cxx6
4 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index c9cdd3316376..a67dc496731a 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -3838,7 +3838,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD
SingleDoubleRefModifier aMod(*t);
ScComplexRefData& rRef = aMod.Ref();
ScRange aAbs = rRef.toAbs(*pDocument, aOldPos);
- bool bMod = (ScRefUpdate::UpdateTranspose(pDocument, rSource, rDest, aAbs) != UR_NOTHING || bPosChanged);
+ bool bMod = (ScRefUpdate::UpdateTranspose(*pDocument, rSource, rDest, aAbs) != UR_NOTHING || bPosChanged);
if (bMod)
{
rRef.SetRange(pDocument->GetSheetLimits(), aAbs, aPos); // based on the new anchor position.
diff --git a/sc/source/core/inc/refupdat.hxx b/sc/source/core/inc/refupdat.hxx
index 254423c9555d..52c1402e6283 100644
--- a/sc/source/core/inc/refupdat.hxx
+++ b/sc/source/core/inc/refupdat.hxx
@@ -60,7 +60,7 @@ public:
SCCOL nMaxCol, SCROW nMaxRow, ScComplexRefData& rRef );
static ScRefUpdateRes UpdateTranspose(
- const ScDocument* pDoc, const ScRange& rSource, const ScAddress& rDest, ScRange& rRef );
+ const ScDocument& rDoc, const ScRange& rSource, const ScAddress& rDest, ScRange& rRef );
static void DoTranspose( SCCOL& rCol, SCROW& rRow, SCTAB& rTab, const ScDocument* pDoc,
const ScRange& rSource, const ScAddress& rDest );
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index 26756b6ba525..93037c73b538 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -293,7 +293,7 @@ void ScRangeData::UpdateTranspose( const ScRange& rSource, const ScAddress& rDes
(!rRef.Ref2.IsFlag3D() || !rRef.Ref2.IsTabRel()))))
{
ScRange aAbs = rRef.toAbs(rDoc, aPos);
- if (ScRefUpdate::UpdateTranspose(&rDoc, rSource, rDest, aAbs) != UR_NOTHING)
+ if (ScRefUpdate::UpdateTranspose(rDoc, rSource, rDest, aAbs) != UR_NOTHING)
{
rRef.SetRange(rDoc.GetSheetLimits(), aAbs, aPos);
bChanged = true;
diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx
index a2da56ffc26f..68cc9d173414 100644
--- a/sc/source/core/tool/refupdat.cxx
+++ b/sc/source/core/tool/refupdat.cxx
@@ -531,7 +531,7 @@ void ScRefUpdate::DoTranspose( SCCOL& rCol, SCROW& rRow, SCTAB& rTab,
}
ScRefUpdateRes ScRefUpdate::UpdateTranspose(
- const ScDocument* pDoc, const ScRange& rSource, const ScAddress& rDest, ScRange& rRef )
+ const ScDocument& rDoc, const ScRange& rSource, const ScAddress& rDest, ScRange& rRef )
{
ScRefUpdateRes eRet = UR_NOTHING;
if (rRef.aStart.Col() >= rSource.aStart.Col() && rRef.aEnd.Col() <= rSource.aEnd.Col() &&
@@ -542,8 +542,8 @@ ScRefUpdateRes ScRefUpdate::UpdateTranspose(
SCCOL nCol1 = rRef.aStart.Col(), nCol2 = rRef.aEnd.Col();
SCROW nRow1 = rRef.aStart.Row(), nRow2 = rRef.aEnd.Row();
SCTAB nTab1 = rRef.aStart.Tab(), nTab2 = rRef.aEnd.Tab();
- DoTranspose(nCol1, nRow1, nTab1, pDoc, rSource, rDest);
- DoTranspose(nCol2, nRow2, nTab2, pDoc, rSource, rDest);
+ DoTranspose(nCol1, nRow1, nTab1, &rDoc, rSource, rDest);
+ DoTranspose(nCol2, nRow2, nTab2, &rDoc, rSource, rDest);
rRef.aStart = ScAddress(nCol1, nRow1, nTab1);
rRef.aEnd = ScAddress(nCol2, nRow2, nTab2);
eRet = UR_UPDATED;