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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 14 08:01:32 UTC 2020


 sc/source/core/inc/refupdat.hxx  |    2 +-
 sc/source/core/tool/compiler.cxx |    8 ++++----
 sc/source/core/tool/refupdat.cxx |    8 ++++----
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit da3c5635add31f4df1fcdb6974430d2318a9c90a
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Sep 13 20:14:31 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Sep 14 10:00:53 2020 +0200

    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 at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

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,


More information about the Libreoffice-commits mailing list