diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2021-03-30 11:13:47 +0200 |
---|---|---|
committer | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2021-04-09 09:40:38 +0200 |
commit | aed1937e7efdf9a6d8c831edef73ec822832ea4e (patch) | |
tree | ecc0aa191dd00739fa31ca75f5ae7a906a6be905 /sc/source/core/tool | |
parent | 0b62ab983f99805d69c8a2c9d32a410d3daf0e9e (diff) |
tdf#119457 - check for a valid range name and cell reference
Change-Id: If23eda52142ba5e59cfd354f2177b1ac1727efaa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113341
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'sc/source/core/tool')
-rw-r--r-- | sc/source/core/tool/rangenam.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx index 6779ffa023b9..c276f30bc783 100644 --- a/sc/source/core/tool/rangenam.cxx +++ b/sc/source/core/tool/rangenam.cxx @@ -467,15 +467,15 @@ ScRangeData::IsNameValidType ScRangeData::IsNameValid( const OUString& rName, co * ScfTools::ConvertToScDefinedName needs to be changed too. */ char const a('.'); if (rName.indexOf(a) != -1) - return NAME_INVALID_BAD_STRING; + return IsNameValidType::NAME_INVALID_BAD_STRING; sal_Int32 nPos = 0; sal_Int32 nLen = rName.getLength(); if ( !nLen || !ScCompiler::IsCharFlagAllConventions( rName, nPos++, ScCharFlags::CharName ) ) - return NAME_INVALID_BAD_STRING; + return IsNameValidType::NAME_INVALID_BAD_STRING; while ( nPos < nLen ) { if ( !ScCompiler::IsCharFlagAllConventions( rName, nPos++, ScCharFlags::Name ) ) - return NAME_INVALID_BAD_STRING; + return IsNameValidType::NAME_INVALID_BAD_STRING; } ScAddress aAddr; ScRange aRange; @@ -487,10 +487,10 @@ ScRangeData::IsNameValidType ScRangeData::IsNameValid( const OUString& rName, co if (aRange.Parse(rName, rDoc, details) != ScRefFlags::ZERO || aAddr.Parse(rName, rDoc, details) != ScRefFlags::ZERO ) { - return NAME_INVALID_CELL_REF; + return IsNameValidType::NAME_INVALID_CELL_REF; } } - return NAME_VALID; + return IsNameValidType::NAME_VALID; } FormulaError ScRangeData::GetErrCode() const |