summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-15 12:15:43 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-16 14:22:34 +0200
commitb49dada831604bbc929323719106c2474ef1102a (patch)
tree793d4a4c90e46237dc4b17cfd3032dae364178d8 /sc/source
parentb979802fc92c8386fa35893f3c620082cec8fbde (diff)
IsNameValid never passed a null ScDocument*
Change-Id: I2bef21f5c6356823b3c0470e7640896740e2ee9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102844 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/tool/rangenam.cxx6
-rw-r--r--sc/source/ui/app/inputwin.cxx2
-rw-r--r--sc/source/ui/dbgui/dbnamdlg.cxx2
-rw-r--r--sc/source/ui/namedlg/namedefdlg.cxx2
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx2
-rw-r--r--sc/source/ui/vba/vbanames.cxx4
6 files changed, 9 insertions, 9 deletions
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index a02191038db2..639b7734da92 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -464,7 +464,7 @@ void ScRangeData::MakeValidName( const ScDocument& rDoc, OUString& rName )
}
}
-ScRangeData::IsNameValidType ScRangeData::IsNameValid( const OUString& rName, const ScDocument* pDoc )
+ScRangeData::IsNameValidType ScRangeData::IsNameValid( const OUString& rName, const ScDocument& rDoc )
{
/* XXX If changed, sc/source/filter/ftools/ftools.cxx
* ScfTools::ConvertToScDefinedName needs to be changed too. */
@@ -487,8 +487,8 @@ ScRangeData::IsNameValidType ScRangeData::IsNameValid( const OUString& rName, co
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!
- if (aRange.Parse(rName, pDoc, details) != ScRefFlags::ZERO ||
- aAddr.Parse(rName, pDoc, details) != ScRefFlags::ZERO )
+ if (aRange.Parse(rName, &rDoc, details) != ScRefFlags::ZERO ||
+ aAddr.Parse(rName, &rDoc, details) != ScRefFlags::ZERO )
{
return NAME_INVALID_CELL_REF;
}
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 03cf77098523..ddece83a3b2a 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2339,7 +2339,7 @@ static ScNameInputType lcl_GetInputType( const OUString& rText )
eRet = SC_NAME_INPUT_ROW;
else if ( rDoc.GetTable( rText, nNameTab ) )
eRet = SC_NAME_INPUT_SHEET;
- else if ( ScRangeData::IsNameValid( rText, &rDoc ) == ScRangeData::NAME_VALID ) // nothing found, create new range?
+ else if ( ScRangeData::IsNameValid( rText, rDoc ) == ScRangeData::NAME_VALID ) // nothing found, create new range?
{
if ( rViewData.GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
eRet = SC_NAME_INPUT_DEFINE;
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 8b79e7fa3f5e..f49e6ac617fa 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -407,7 +407,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl, weld::Button&, void)
if ( aNewName.isEmpty() || aNewArea.isEmpty() )
return;
- if ( ScRangeData::IsNameValid( aNewName, &rDoc ) == ScRangeData::NAME_VALID && aNewName != STR_DB_LOCAL_NONAME )
+ if ( ScRangeData::IsNameValid( aNewName, rDoc ) == ScRangeData::NAME_VALID && aNewName != STR_DB_LOCAL_NONAME )
{
// because editing can be done now, parsing is needed first
ScRange aTmpRange;
diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx
index 9a4ec692bd7c..fe1db9e5a1aa 100644
--- a/sc/source/ui/namedlg/namedefdlg.cxx
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -139,7 +139,7 @@ bool ScNameDefDlg::IsNameValid()
m_xFtInfo->set_label(maStrInfoDefault);
return false;
}
- else if ((eType = ScRangeData::IsNameValid( aName, &mrDoc )) != ScRangeData::NAME_VALID)
+ else if ((eType = ScRangeData::IsNameValid( aName, mrDoc )) != ScRangeData::NAME_VALID)
{
m_xFtInfo->set_label_type(weld::LabelType::Error);
if (eType == ScRangeData::NAME_INVALID_BAD_STRING)
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 140e74eb547e..6ba2852a1122 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -248,7 +248,7 @@ bool ScNameDlg::IsNameValid()
ScRangeName* pRangeName = GetRangeName( aScope );
- if (ScRangeData::IsNameValid( aName, &mrDoc ) != ScRangeData::NAME_VALID)
+ if (ScRangeData::IsNameValid( aName, mrDoc ) != ScRangeData::NAME_VALID)
{
m_xFtInfo->set_label_type(weld::LabelType::Error);
m_xFtInfo->set_label(maErrInvalidNameStr);
diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx
index 0fb1a1b677a3..1b498536ad9f 100644
--- a/sc/source/ui/vba/vbanames.cxx
+++ b/sc/source/ui/vba/vbanames.cxx
@@ -104,12 +104,12 @@ ScVbaNames::Add( const css::uno::Any& Name ,
NameLocal >>= sName;
if ( !sName.isEmpty() )
{
- if ( ScRangeData::IsNameValid( sName , &getScDocument() ) != ScRangeData::NAME_VALID )
+ if ( ScRangeData::IsNameValid( sName, getScDocument() ) != ScRangeData::NAME_VALID )
{
const sal_Int32 nIndex{ sName.indexOf('!') };
if (nIndex>=0)
sName = sName.copy(nIndex+1);
- if ( ScRangeData::IsNameValid( sName , &getScDocument() ) != ScRangeData::NAME_VALID )
+ if ( ScRangeData::IsNameValid( sName, getScDocument() ) != ScRangeData::NAME_VALID )
throw uno::RuntimeException( "This Name is not valid ." );
}
}