[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Fri Jun 10 07:45:22 PDT 2011
sc/source/core/tool/rangenam.cxx | 3 +++
sc/source/filter/ftools/ftools.cxx | 2 ++
2 files changed, 5 insertions(+)
New commits:
commit fc7e9ce79a9cc518b26440fb3e37f832371d8422
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Jun 10 15:44:34 2011 +0200
fix for fdo#37872: we don't allow points in range names any more
Signed-off-by: Kohei Yoshida <kyoshida at novell.com>
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index 94d6797..efad9fe 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -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 ) )
diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx
index ad9f185..96d0eea 100644
--- a/sc/source/filter/ftools/ftools.cxx
+++ b/sc/source/filter/ftools/ftools.cxx
@@ -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, '_' );
More information about the Libreoffice-commits
mailing list