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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 15 14:46:10 UTC 2020


 sc/inc/rangenam.hxx               |    2 +-
 sc/source/core/tool/rangenam.cxx  |    6 +++---
 sc/source/ui/docshell/docfunc.cxx |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 587a0c682308bb63462d4d8074d59f6fa8a9a51d
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Sep 14 15:17:27 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Sep 15 16:45:27 2020 +0200

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

diff --git a/sc/inc/rangenam.hxx b/sc/inc/rangenam.hxx
index 3239031dc5ab..5d8ba1be6773 100644
--- a/sc/inc/rangenam.hxx
+++ b/sc/inc/rangenam.hxx
@@ -153,7 +153,7 @@ public:
 
     void            ValidateTabRefs();
 
-    static void     MakeValidName( const ScDocument* pDoc, OUString& rName );
+    static void     MakeValidName( const ScDocument& rDoc, OUString& rName );
 
     SC_DLLPUBLIC static IsNameValidType     IsNameValid( const OUString& rName, const ScDocument* pDoc );
 
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index 93037c73b538..a02191038db2 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -419,7 +419,7 @@ void ScRangeData::UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt, SCTAB nLocal
     aPos.SetTab(rCxt.getNewTab(aPos.Tab()));
 }
 
-void ScRangeData::MakeValidName( const ScDocument* pDoc, OUString& rName )
+void ScRangeData::MakeValidName( const ScDocument& rDoc, OUString& rName )
 {
 
     // strip leading invalid characters
@@ -451,8 +451,8 @@ void ScRangeData::MakeValidName( const ScDocument* pDoc, OUString& rName )
         ScAddress::Details details( static_cast<FormulaGrammar::AddressConvention>( nConv ) );
         // Don't check Parse on VALID, any partial only VALID may result in
         // #REF! during compile later!
-        while (aRange.Parse(rName, pDoc, details) != ScRefFlags::ZERO ||
-                aAddr.Parse(rName, pDoc, details) != ScRefFlags::ZERO)
+        while (aRange.Parse(rName, &rDoc, details) != ScRefFlags::ZERO ||
+                aAddr.Parse(rName, &rDoc, details) != ScRefFlags::ZERO)
         {
             // Range Parse is partially valid also with invalid sheet name,
             // Address Parse ditto, during compile name would generate a #REF!
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 2d60e831cef8..ab353c1699f1 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -5208,7 +5208,7 @@ void ScDocFunc::CreateOneName( ScRangeName& rList,
         return;
 
     OUString aName = rDoc.GetString(nPosX, nPosY, nTab);
-    ScRangeData::MakeValidName(&rDoc, aName);
+    ScRangeData::MakeValidName(rDoc, aName);
     if (aName.isEmpty())
         return;
 


More information about the Libreoffice-commits mailing list