summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-13 20:14:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-14 10:00:53 +0200
commitda3c5635add31f4df1fcdb6974430d2318a9c90a (patch)
treee275adfb2aff0359b78d0219b83d86b29c302696
parent4074cd73933276f2d4742ecb7ebce30362ba24c1 (diff)
ScRefUpdate::MoveRelWrap always dereferences its ScDocument* arg
Change-Id: Ib1030fe43a0fcd912074ff3582f99f81bf19c0e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102614 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/core/inc/refupdat.hxx2
-rw-r--r--sc/source/core/tool/compiler.cxx8
-rw-r--r--sc/source/core/tool/refupdat.cxx8
3 files changed, 9 insertions, 9 deletions
diff --git a/sc/source/core/inc/refupdat.hxx b/sc/source/core/inc/refupdat.hxx
index 1ddfd36ae42b..254423c9555d 100644
--- a/sc/source/core/inc/refupdat.hxx
+++ b/sc/source/core/inc/refupdat.hxx
@@ -56,7 +56,7 @@ public:
sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz,
ScBigRange& rWhat );
- static void MoveRelWrap( const ScDocument* pDoc, const ScAddress& rPos,
+ static void MoveRelWrap( const ScDocument& rDoc, const ScAddress& rPos,
SCCOL nMaxCol, SCROW nMaxRow, ScComplexRefData& rRef );
static ScRefUpdateRes UpdateTranspose(
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index aad726849ad4..337c936690fd 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4999,9 +4999,9 @@ void ScCompiler::MoveRelWrap()
for ( auto t: pArr->References() )
{
if ( t->GetType() == svSingleRef || t->GetType() == svExternalSingleRef )
- ScRefUpdate::MoveRelWrap( pDoc, aPos, pDoc->MaxCol(), pDoc->MaxRow(), SingleDoubleRefModifier( *t->GetSingleRef() ).Ref() );
+ ScRefUpdate::MoveRelWrap( *pDoc, aPos, pDoc->MaxCol(), pDoc->MaxRow(), SingleDoubleRefModifier( *t->GetSingleRef() ).Ref() );
else
- ScRefUpdate::MoveRelWrap( pDoc, aPos, pDoc->MaxCol(), pDoc->MaxRow(), *t->GetDoubleRef() );
+ ScRefUpdate::MoveRelWrap( *pDoc, aPos, pDoc->MaxCol(), pDoc->MaxRow(), *t->GetDoubleRef() );
}
}
@@ -5013,9 +5013,9 @@ void ScCompiler::MoveRelWrap( const ScTokenArray& rArr, const ScDocument* pDoc,
for ( auto t: rArr.References() )
{
if ( t->GetType() == svSingleRef || t->GetType() == svExternalSingleRef )
- ScRefUpdate::MoveRelWrap( pDoc, rPos, nMaxCol, nMaxRow, SingleDoubleRefModifier( *t->GetSingleRef() ).Ref() );
+ ScRefUpdate::MoveRelWrap( *pDoc, rPos, nMaxCol, nMaxRow, SingleDoubleRefModifier( *t->GetSingleRef() ).Ref() );
else
- ScRefUpdate::MoveRelWrap( pDoc, rPos, nMaxCol, nMaxRow, *t->GetDoubleRef() );
+ ScRefUpdate::MoveRelWrap( *pDoc, rPos, nMaxCol, nMaxRow, *t->GetDoubleRef() );
}
}
diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx
index f3d0014e7924..a2da56ffc26f 100644
--- a/sc/source/core/tool/refupdat.cxx
+++ b/sc/source/core/tool/refupdat.cxx
@@ -460,10 +460,10 @@ ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode eUpdateRefMode,
return eRet;
}
-void ScRefUpdate::MoveRelWrap( const ScDocument* pDoc, const ScAddress& rPos,
+void ScRefUpdate::MoveRelWrap( const ScDocument& rDoc, const ScAddress& rPos,
SCCOL nMaxCol, SCROW nMaxRow, ScComplexRefData& rRef )
{
- ScRange aAbsRange = rRef.toAbs(*pDoc, rPos);
+ ScRange aAbsRange = rRef.toAbs(rDoc, rPos);
if( rRef.Ref1.IsColRel() )
{
SCCOL nCol = aAbsRange.aStart.Col();
@@ -488,7 +488,7 @@ void ScRefUpdate::MoveRelWrap( const ScDocument* pDoc, const ScAddress& rPos,
lcl_MoveItWrap(nRow, nMaxRow);
aAbsRange.aEnd.SetRow(nRow);
}
- SCTAB nMaxTab = pDoc->GetTableCount() - 1;
+ SCTAB nMaxTab = rDoc.GetTableCount() - 1;
if( rRef.Ref1.IsTabRel() )
{
SCTAB nTab = aAbsRange.aStart.Tab();
@@ -503,7 +503,7 @@ void ScRefUpdate::MoveRelWrap( const ScDocument* pDoc, const ScAddress& rPos,
}
aAbsRange.PutInOrder();
- rRef.SetRange(pDoc->GetSheetLimits(), aAbsRange, rPos);
+ rRef.SetRange(rDoc.GetSheetLimits(), aAbsRange, rPos);
}
void ScRefUpdate::DoTranspose( SCCOL& rCol, SCROW& rRow, SCTAB& rTab,