summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-14 11:04:05 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-15 09:47:05 +0200
commit4ef697e670aaa7cac547846ac961e6d26aac816d (patch)
treec661e36aae95370cc0ee9ba64314f7c00899d6fa
parente24430486f9c584fb687fe6897807d6cb9f1f217 (diff)
ScRefUpdate::DoTranspose always dereferences its ScDocument* argument
Change-Id: If61bdc93954177792ec750836a87d7f9a1ba1730 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102665 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/refupdat.cxx8
3 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 50fd18bf4293..5d3502c2dfcf 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -3813,7 +3813,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD
SCCOL nRelPosX = aOldPos.Col();
SCROW nRelPosY = aOldPos.Row();
SCTAB nRelPosZ = aOldPos.Tab();
- ScRefUpdate::DoTranspose( nRelPosX, nRelPosY, nRelPosZ, pDocument, aDestRange, rSource.aStart );
+ ScRefUpdate::DoTranspose( nRelPosX, nRelPosY, nRelPosZ, *pDocument, aDestRange, rSource.aStart );
aOldPos.Set( nRelPosX, nRelPosY, nRelPosZ );
bPosChanged = true;
}
diff --git a/sc/source/core/inc/refupdat.hxx b/sc/source/core/inc/refupdat.hxx
index 52c1402e6283..1601c66bfe6c 100644
--- a/sc/source/core/inc/refupdat.hxx
+++ b/sc/source/core/inc/refupdat.hxx
@@ -62,7 +62,7 @@ public:
static ScRefUpdateRes UpdateTranspose(
const ScDocument& rDoc, const ScRange& rSource, const ScAddress& rDest, ScRange& rRef );
- static void DoTranspose( SCCOL& rCol, SCROW& rRow, SCTAB& rTab, const ScDocument* pDoc,
+ static void DoTranspose( SCCOL& rCol, SCROW& rRow, SCTAB& rTab, const ScDocument& rDoc,
const ScRange& rSource, const ScAddress& rDest );
static ScRefUpdateRes UpdateGrow(
diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx
index 68cc9d173414..3a1693edebfc 100644
--- a/sc/source/core/tool/refupdat.cxx
+++ b/sc/source/core/tool/refupdat.cxx
@@ -507,13 +507,13 @@ void ScRefUpdate::MoveRelWrap( const ScDocument& rDoc, const ScAddress& rPos,
}
void ScRefUpdate::DoTranspose( SCCOL& rCol, SCROW& rRow, SCTAB& rTab,
- const ScDocument* pDoc, const ScRange& rSource, const ScAddress& rDest )
+ const ScDocument& rDoc, const ScRange& rSource, const ScAddress& rDest )
{
SCTAB nDz = rDest.Tab() - rSource.aStart.Tab();
if (nDz)
{
SCTAB nNewTab = rTab+nDz;
- SCTAB nCount = pDoc->GetTableCount();
+ SCTAB nCount = rDoc.GetTableCount();
while (nNewTab<0) nNewTab = sal::static_int_cast<SCTAB>( nNewTab + nCount );
while (nNewTab>=nCount) nNewTab = sal::static_int_cast<SCTAB>( nNewTab - nCount );
rTab = nNewTab;
@@ -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, &rDoc, rSource, rDest);
- DoTranspose(nCol2, nRow2, nTab2, &rDoc, 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;