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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 14 07:55:19 UTC 2020


 sc/source/filter/inc/lotform.hxx   |    6 +++---
 sc/source/filter/inc/qproform.hxx  |    2 +-
 sc/source/filter/lotus/lotform.cxx |    6 +++---
 sc/source/filter/qpro/qproform.cxx |   10 +++++-----
 4 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 74712cf10154c52a01388c3e59759c43396048ba
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Sep 13 19:41:36 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Sep 14 09:54:27 2020 +0200

    ReadSRD never called with a nullptr
    
    Change-Id: I995e602668c4cbeb11bc167b2e98aec6528a3b27
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102603
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/filter/inc/lotform.hxx b/sc/source/filter/inc/lotform.hxx
index be2dfd1910fb..a9937d458115 100644
--- a/sc/source/filter/inc/lotform.hxx
+++ b/sc/source/filter/inc/lotform.hxx
@@ -75,7 +75,7 @@ private:
     bool                bWK3;       // alternative Code translation for < WK1
     bool                bWK123;     // alternative for 123
 
-    void                ReadSRD( const ScDocument* pDoc, ScSingleRefData& rSRD, sal_uInt8 nFlags );
+    void                ReadSRD( const ScDocument& rDoc, ScSingleRefData& rSRD, sal_uInt8 nFlags );
     inline void         ReadCRD( const ScDocument& rDoc, ScComplexRefData& rCRD, sal_uInt8 nFlags );
     void                IncToken( TokenId &rParam );
                         // Attention: here the Token-chain is extended in Pool
@@ -101,10 +101,10 @@ private:
 inline void LotusToSc::ReadCRD( const ScDocument& rDoc, ScComplexRefData& rCRD, sal_uInt8 nRelBit )
 {
     // 1st part
-    ReadSRD( &rDoc, rCRD.Ref1, nRelBit );
+    ReadSRD( rDoc, rCRD.Ref1, nRelBit );
 
     // 2nd part
-    ReadSRD( &rDoc, rCRD.Ref2, nRelBit >> 3 );
+    ReadSRD( rDoc, rCRD.Ref2, nRelBit >> 3 );
 }
 
 inline void LotusToSc::SetWK3()
diff --git a/sc/source/filter/inc/qproform.hxx b/sc/source/filter/inc/qproform.hxx
index c9cded627d79..a4e643f433e1 100644
--- a/sc/source/filter/inc/qproform.hxx
+++ b/sc/source/filter/inc/qproform.hxx
@@ -60,7 +60,7 @@ public:
     QProToSc( SvStream &aStr, svl::SharedStringPool& rSPool, const ScAddress& rRefPos );
     ConvErr Convert( const ScDocument& rDoc, std::unique_ptr<ScTokenArray>& pArray );
     void DoFunc( DefTokenId eOc, sal_uInt16 nArgs, const char* pExtString );
-    void ReadSRD( const ScDocument* pDoc, ScSingleRefData& rR, sal_Int8 nPage, sal_Int8 nCol, sal_uInt16 rRel );
+    void ReadSRD( const ScDocument& rDoc, ScSingleRefData& rR, sal_Int8 nPage, sal_Int8 nCol, sal_uInt16 rRel );
     void IncToken( TokenId &aParam );
     static DefTokenId IndexToToken( sal_uInt16 nToken );
     static QPRO_FUNC_TYPE IndexToType( sal_uInt8 nToken );
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index ac62e9fddfe3..11d231443111 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -317,7 +317,7 @@ void LotusToSc::LotusRelToScRel( sal_uInt16 nCol, sal_uInt16 nRow, ScSingleRefDa
         rSRD.SetAbsRow(static_cast<SCROW>(nRow));
 }
 
-void LotusToSc::ReadSRD( const ScDocument* pDoc, ScSingleRefData& rSRD, sal_uInt8 nRelBit )
+void LotusToSc::ReadSRD( const ScDocument& rDoc, ScSingleRefData& rSRD, sal_uInt8 nRelBit )
 {
     sal_uInt8           nTab, nCol;
     sal_uInt16          nRow;
@@ -333,7 +333,7 @@ void LotusToSc::ReadSRD( const ScDocument* pDoc, ScSingleRefData& rSRD, sal_uInt
     rSRD.SetTabRel( ( ( nRelBit & 0x04) != 0 ) || !b3D );
     rSRD.SetFlag3D( b3D );
 
-    rSRD.SetAddress(pDoc->GetSheetLimits(), ScAddress(nCol, nRow, nTab), aEingPos);
+    rSRD.SetAddress(rDoc.GetSheetLimits(), ScAddress(nCol, nRow, nTab), aEingPos);
 }
 
 void LotusToSc::IncToken( TokenId &rParam )
@@ -552,7 +552,7 @@ void LotusToSc::Convert( std::unique_ptr<ScTokenArray>& rpErg, sal_Int32& rRest
             // for > WK3
             case FT_Cref:
                 Read( nRelBits );
-                ReadSRD( &m_rContext.rDoc, rR, nRelBits );
+                ReadSRD( m_rContext.rDoc, rR, nRelBits );
                 aStack << aPool.Store( rR );
                 break;
             case FT_Rref:
diff --git a/sc/source/filter/qpro/qproform.cxx b/sc/source/filter/qpro/qproform.cxx
index c78cf1acc0fb..6f0b6b8ea7a1 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -26,7 +26,7 @@
 #include <formel.hxx>
 #include <tokstack.hxx>
 
-void QProToSc::ReadSRD( const ScDocument* pDoc, ScSingleRefData& rSRD, sal_Int8 nPage, sal_Int8 nCol, sal_uInt16 nRelBit )
+void QProToSc::ReadSRD( const ScDocument& rDoc, ScSingleRefData& rSRD, sal_Int8 nPage, sal_Int8 nCol, sal_uInt16 nRelBit )
 {
     sal_uInt16 nTmp = nRelBit & 0x1fff;
     rSRD.InitAddress( ScAddress( nCol, (~nTmp + 1), 0 ) );
@@ -57,7 +57,7 @@ void QProToSc::ReadSRD( const ScDocument* pDoc, ScSingleRefData& rSRD, sal_Int8
     {
         rSRD.SetAbsTab(nPage);
     }
-    if (rSRD.toAbs(*pDoc, aEingPos).Tab() != aEingPos.Tab())
+    if (rSRD.toAbs(rDoc, aEingPos).Tab() != aEingPos.Tab())
         rSRD.SetFlag3D(true);
 }
 
@@ -320,17 +320,17 @@ ConvErr QProToSc::Convert( const ScDocument& rDoc, std::unique_ptr<ScTokenArray>
             case FT_Cref : // Single cell reference
                 maIn.ReadUInt16( nNote ).ReadSChar( nCol ).ReadSChar( nPage ).ReadUInt16( nRelBits );
                 SAFEREAD_OR_BREAK( maIn, i, nRef, eRet, ConvErr::Count);
-                ReadSRD( &rDoc, aSRD, nPage, nCol, nRelBits );
+                ReadSRD( rDoc, aSRD, nPage, nCol, nRelBits );
                 aStack << aPool.Store( aSRD );
                 break;
 
             case FT_Range: // Block reference
                 maIn.ReadUInt16( nNote ).ReadSChar( nCol ).ReadSChar( nPage ).ReadUInt16( nRelBits );
                 SAFEREAD_OR_BREAK( maIn, i, nRef, eRet, ConvErr::Count);
-                ReadSRD( &rDoc, aCRD.Ref1, nPage, nCol, nRelBits );
+                ReadSRD( rDoc, aCRD.Ref1, nPage, nCol, nRelBits );
                 maIn.ReadSChar( nCol ).ReadSChar( nPage ).ReadUInt16( nRelBits );
                 SAFEREAD_OR_BREAK( maIn, i, nRef, eRet, ConvErr::Count);
-                ReadSRD( &rDoc, aCRD.Ref2, nPage, nCol, nRelBits );
+                ReadSRD( rDoc, aCRD.Ref2, nPage, nCol, nRelBits );
                 // Sheet name of second corner is not displayed if identical
                 if (aCRD.Ref1.IsFlag3D() && aCRD.Ref1.Tab() == aCRD.Ref2.Tab() &&
                         aCRD.Ref1.IsTabRel() == aCRD.Ref2.IsTabRel())


More information about the Libreoffice-commits mailing list