[Libreoffice-commits] core.git: include/unotools sc/source
Arnaud Versini
arnaud.versini at gmail.com
Mon Jun 24 15:03:51 PDT 2013
include/unotools/charclass.hxx | 8 ++++----
sc/source/core/tool/compiler.cxx | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
New commits:
commit 337225b36a2965cca532c73f02e9313149f73d80
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date: Sat Jun 22 14:51:36 2013 +0200
Replace more characters functions with rtl/character.hxx
Change-Id: I70f3c31e4b2f44d2b30020a588aaa53d3b63d452
Reviewed-on: https://gerrit.libreoffice.org/4447
Tested-by: LibreOffice gerrit bot <gerrit at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx
index 6ea11f6..3ff8345 100644
--- a/include/unotools/charclass.hxx
+++ b/include/unotools/charclass.hxx
@@ -21,7 +21,6 @@
#ifndef _UNOTOOLS_CHARCLASS_HXX
#define _UNOTOOLS_CHARCLASS_HXX
-#include <ctype.h> // isdigit(), isalpha()
#include <boost/noncopyable.hpp>
#include <i18nlangtag/languagetag.hxx>
#include <tools/string.hxx>
@@ -32,6 +31,7 @@
#include <com/sun/star/i18n/ParseResult.hpp>
#include <com/sun/star/i18n/XCharacterClassification.hpp>
#include <osl/mutex.hxx>
+#include <rtl/character.hxx>
class String;
namespace com { namespace sun { namespace star {
@@ -95,19 +95,19 @@ public:
/// isdigit() on ascii values
static inline sal_Bool isAsciiDigit( sal_Unicode c )
{
- return c < 128 ? sal_Bool(isdigit( (unsigned char) c ) != 0) : sal_False;
+ return rtl::isAsciiDigit( c );
}
/// isalpha() on ascii values
static inline sal_Bool isAsciiAlpha( sal_Unicode c )
{
- return c < 128 ? sal_Bool(isalpha( (unsigned char) c ) != 0) : sal_False;
+ return rtl::isAsciiAlpha( c );
}
/// isalnum() on ascii values
static inline sal_Bool isAsciiAlphaNumeric( sal_Unicode c )
{
- return c < 128 ? sal_Bool(isalnum( (unsigned char) c ) != 0) : sal_False;
+ return rtl::isAsciiAlphanumeric( c );
}
/// isdigit() on ascii values of entire string
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index afd50e1..d0ef4ad 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -570,7 +570,7 @@ static bool lcl_parseExternalName(
{
do
{
- if (CharClass::isAsciiAlphaNumeric(c))
+ if (rtl::isAsciiAlphanumeric(c))
// allowed.
break;
@@ -2156,7 +2156,7 @@ Label_MaskStateMachine:
}
}
else if ((nMask & SC_COMPILER_C_WORD_SEP) ||
- (c < 128 && !CharClass::isAsciiAlphaNumeric( c)))
+ (c < 128 && !rtl::isAsciiAlphanumeric( c)))
{
bAdd = false;
eState = ssStop;
@@ -2781,7 +2781,7 @@ bool ScCompiler::IsReference( const String& rName )
if ( ch1 == cDecSep )
return false;
// Who was that imbecile introducing '.' as the sheet name separator!?!
- if ( CharClass::isAsciiNumeric( OUString(ch1) ) )
+ if ( rtl::isAsciiDigit( ch1 ) )
{
// Numerical sheet name is valid.
// But English 1.E2 or 1.E+2 is value 100, 1.E-2 is 0.01
@@ -2798,7 +2798,7 @@ bool ScCompiler::IsReference( const String& rName )
}
sal_Unicode const * const pTabSep = rName.GetBuffer() + nPos;
sal_Unicode ch2 = pTabSep[1]; // maybe a column identifier
- if ( !(ch2 == '$' || CharClass::isAsciiAlpha( ch2 )) )
+ if ( !(ch2 == '$' || rtl::isAsciiAlpha( ch2 )) )
return false;
if ( cDecSep == '.' && (ch2 == 'E' || ch2 == 'e') // E + - digit
&& (GetCharTableFlags( pTabSep[2], pTabSep[1] ) & SC_COMPILER_C_VALUE_EXP) )
More information about the Libreoffice-commits
mailing list