Kaydet (Commit) fde87dc7 authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Kohei Yoshida

fix for fdo#37872: we don't allow points in range names any more

Signed-off-by: 's avatarKohei Yoshida <kyoshida@novell.com>
üst 4216adcf
......@@ -476,6 +476,9 @@ sal_Bool ScRangeData::IsNameValid( const String& rName, ScDocument* pDoc )
{
/* XXX If changed, sc/source/filter/ftools/ftools.cxx
* ScfTools::ConvertToScDefinedName needs to be changed too. */
sal_Char a('.');
if (rName.Search(a, 0) != STRING_NOTFOUND)
return false;
xub_StrLen nPos = 0;
xub_StrLen nLen = rName.Len();
if ( !nLen || !ScCompiler::IsCharFlagAllConventions( rName, nPos++, SC_COMPILER_C_CHAR_NAME ) )
......
......@@ -162,6 +162,8 @@ Color ScfTools::GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt8
void ScfTools::ConvertToScDefinedName( String& rName )
{
sal_Char a('.');
rName.SearchAndReplaceAllAscii(&a,'_'); //fdo#37872: we don't allow points in range names any more
xub_StrLen nLen = rName.Len();
if( nLen && !ScCompiler::IsCharFlagAllConventions( rName, 0, SC_COMPILER_C_CHAR_NAME ) )
rName.SetChar( 0, '_' );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment