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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sun Sep 13 13:18:59 UTC 2020


 sc/source/filter/excel/xetable.cxx   |    2 +-
 sc/source/filter/excel/xlformula.cxx |   12 ++++++------
 sc/source/filter/inc/xlformula.hxx   |    2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit ef1a78ed4d2a083310277e188a02cb1b5323a089
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Sep 12 16:58:04 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Sep 13 15:18:19 2020 +0200

    GetMultipleOpRefs never passed a null ScDocument*
    
    Change-Id: Ib31f77d8cf669881df5cc23bdd91278531c1f8ad
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102531
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 1b96f91ac788..fd8ec5a28d9f 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -459,7 +459,7 @@ XclExpTableopRef XclExpTableopBuffer::CreateOrExtendTableop(
 
     // try to extract cell references of a multiple operations formula
     XclMultipleOpRefs aRefs;
-    if (XclTokenArrayHelper::GetMultipleOpRefs(&GetDoc(), aRefs, rScTokArr, rScPos))
+    if (XclTokenArrayHelper::GetMultipleOpRefs(GetDoc(), aRefs, rScTokArr, rScPos))
     {
         // try to find an existing TABLEOP record for this cell position
         for( size_t nPos = 0, nSize = maTableopList.GetSize(); !xRec && (nPos < nSize); ++nPos )
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index 01f1dc2ad724..adafca569352 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -940,7 +940,7 @@ bool lclGetAddress( const ScDocument* pDoc, ScAddress& rAddress, const FormulaTo
 } // namespace
 
 bool XclTokenArrayHelper::GetMultipleOpRefs(
-    const ScDocument* pDoc,
+    const ScDocument& rDoc,
     XclMultipleOpRefs& rRefs, const ScTokenArray& rScTokArr, const ScAddress& rScPos )
 {
     rRefs.mbDblRefMode = false;
@@ -963,32 +963,32 @@ bool XclTokenArrayHelper::GetMultipleOpRefs(
                 eState = (eOpCode == ocOpen) ? stOpen : stError;
             break;
             case stOpen:
-                eState = lclGetAddress(pDoc, rRefs.maFmlaScPos, *aIt, rScPos) ? stFormula : stError;
+                eState = lclGetAddress(&rDoc, rRefs.maFmlaScPos, *aIt, rScPos) ? stFormula : stError;
             break;
             case stFormula:
                 eState = bIsSep ? stFormulaSep : stError;
             break;
             case stFormulaSep:
-                eState = lclGetAddress(pDoc, rRefs.maColFirstScPos, *aIt, rScPos) ? stColFirst : stError;
+                eState = lclGetAddress(&rDoc, rRefs.maColFirstScPos, *aIt, rScPos) ? stColFirst : stError;
             break;
             case stColFirst:
                 eState = bIsSep ? stColFirstSep : stError;
             break;
             case stColFirstSep:
-                eState = lclGetAddress(pDoc, rRefs.maColRelScPos, *aIt, rScPos) ? stColRel : stError;
+                eState = lclGetAddress(&rDoc, rRefs.maColRelScPos, *aIt, rScPos) ? stColRel : stError;
             break;
             case stColRel:
                 eState = bIsSep ? stColRelSep : ((eOpCode == ocClose) ? stClose : stError);
             break;
             case stColRelSep:
-                eState = lclGetAddress(pDoc, rRefs.maRowFirstScPos, *aIt, rScPos) ? stRowFirst : stError;
+                eState = lclGetAddress(&rDoc, rRefs.maRowFirstScPos, *aIt, rScPos) ? stRowFirst : stError;
                 rRefs.mbDblRefMode = true;
             break;
             case stRowFirst:
                 eState = bIsSep ? stRowFirstSep : stError;
             break;
             case stRowFirstSep:
-                eState = lclGetAddress(pDoc, rRefs.maRowRelScPos, *aIt, rScPos) ? stRowRel : stError;
+                eState = lclGetAddress(&rDoc, rRefs.maRowRelScPos, *aIt, rScPos) ? stRowRel : stError;
             break;
             case stRowRel:
                 eState = (eOpCode == ocClose) ? stClose : stError;
diff --git a/sc/source/filter/inc/xlformula.hxx b/sc/source/filter/inc/xlformula.hxx
index 7dd31686a06b..d46f1200358f 100644
--- a/sc/source/filter/inc/xlformula.hxx
+++ b/sc/source/filter/inc/xlformula.hxx
@@ -532,7 +532,7 @@ public:
         @descr  Requires that the formula contains a single MULTIPLE.OPERATION function call.
         Spaces in the formula are silently ignored.
         @return  true = Multiple operation found, and all references successfully extracted. */
-    static bool GetMultipleOpRefs( const ScDocument* pDoc, XclMultipleOpRefs& rRefs, const ScTokenArray& rScTokArr, const ScAddress& rScPos );
+    static bool GetMultipleOpRefs( const ScDocument& rDoc, XclMultipleOpRefs& rRefs, const ScTokenArray& rScTokArr, const ScAddress& rScPos );
 };
 
 inline sal_uInt8 XclTokenArrayHelper::GetTokenId( sal_uInt8 nBaseId, sal_uInt8 nTokenClass )


More information about the Libreoffice-commits mailing list