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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 15 12:12:47 UTC 2020


 sc/inc/rangeutl.hxx              |    2 +-
 sc/source/core/tool/rangeutl.cxx |   10 +++++-----
 sc/source/ui/dbgui/consdlg.cxx   |    2 +-
 sc/source/ui/optdlg/tpusrlst.cxx |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 9bd86da7c5e00ef092fcccfc8c37b9f9ca9dc89b
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Sep 14 12:22:57 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Sep 15 14:11:57 2020 +0200

    ScRangeUtil::IsAbsArea ScDocument* arg dereferenced on all branches
    
    Change-Id: Ie83a42db769b45f6d64d0c2b7fda58216efc36c1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102718
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/inc/rangeutl.hxx b/sc/inc/rangeutl.hxx
index 62fb8fe0a4b3..601fdee3803f 100644
--- a/sc/inc/rangeutl.hxx
+++ b/sc/inc/rangeutl.hxx
@@ -57,7 +57,7 @@ public:
                                   ScAddress::Details const & rDetails = ScAddress::detailsOOOa1 );
 
     static bool IsAbsArea       ( const OUString& rAreaStr,
-                                  const ScDocument* pDoc,
+                                  const ScDocument& rDoc,
                                   SCTAB     nTab,
                                   OUString*     pCompleteStr,
                                   ScRefAddress* pStartPos    = nullptr,
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index 47a6008de5d8..1e709a4b7100 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -169,7 +169,7 @@ bool ScRangeUtil::IsAbsTabArea( const OUString&   rAreaStr,
 }
 
 bool ScRangeUtil::IsAbsArea( const OUString&  rAreaStr,
-                             const ScDocument* pDoc,
+                             const ScDocument& rDoc,
                              SCTAB          nTab,
                              OUString*      pCompleteStr,
                              ScRefAddress*  pStartPos,
@@ -179,7 +179,7 @@ bool ScRangeUtil::IsAbsArea( const OUString&  rAreaStr,
     ScRefAddress    startPos;
     ScRefAddress    endPos;
 
-    bool bIsAbsArea = ConvertDoubleRef( pDoc, rAreaStr, nTab, startPos, endPos, rDetails );
+    bool bIsAbsArea = ConvertDoubleRef( &rDoc, rAreaStr, nTab, startPos, endPos, rDetails );
 
     if ( bIsAbsArea )
     {
@@ -192,9 +192,9 @@ bool ScRangeUtil::IsAbsArea( const OUString&  rAreaStr,
 
         if ( pCompleteStr )
         {
-            *pCompleteStr  = startPos.GetRefString( pDoc, MAXTAB+1, rDetails );
+            *pCompleteStr  = startPos.GetRefString( &rDoc, MAXTAB+1, rDetails );
             *pCompleteStr += ":";
-            *pCompleteStr += endPos  .GetRefString( pDoc, nTab, rDetails );
+            *pCompleteStr += endPos.GetRefString( &rDoc, nTab, rDetails );
         }
 
         if ( pStartPos && pEndPos )
@@ -280,7 +280,7 @@ bool ScRangeUtil::MakeRangeFromName (
 
             pData->GetSymbol( aStrArea );
 
-            if ( IsAbsArea( aStrArea, &rDoc, nTable,
+            if ( IsAbsArea( aStrArea, rDoc, nTable,
                             nullptr, &aStartPos, &aEndPos, rDetails ) )
             {
                 nTab       = aStartPos.Tab();
diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx
index 82b117ddf187..18a571a3077d 100644
--- a/sc/source/ui/dbgui/consdlg.cxx
+++ b/sc/source/ui/dbgui/consdlg.cxx
@@ -295,7 +295,7 @@ bool ScConsolidateDlg::VerifyEdit( formula::RefEdit* pEd )
 
     if ( pEd == m_xEdDataArea.get() )
     {
-        bEditOk = ScRangeUtil::IsAbsArea( pEd->GetText(), pDoc,
+        bEditOk = ScRangeUtil::IsAbsArea( pEd->GetText(), *pDoc,
                                          nTab, &theCompleteStr, nullptr, nullptr, eConv );
     }
     else if ( pEd == m_xEdDestArea.get() )
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index e32ebb5de033..9dbb50e52bdb 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -645,7 +645,7 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, weld::Button&, rBtn, void )
         if ( !theAreaStr.isEmpty() )
         {
             bAreaOk = ScRangeUtil::IsAbsArea( theAreaStr,
-                                             pDoc,
+                                             *pDoc,
                                              pViewData->GetTabNo(),
                                              &theAreaStr,
                                              &theStartPos,


More information about the Libreoffice-commits mailing list