diff options
author | Arnaud Versini <arnaud.versini@gmail.com> | 2013-06-22 14:51:36 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-06-24 22:03:31 +0000 |
commit | 337225b36a2965cca532c73f02e9313149f73d80 (patch) | |
tree | 8557073192e5cf2ebea162de936eb3f95d2fb059 | |
parent | 126827b0fdc2277d728d57d4fe68b446fa2f7a08 (diff) |
Replace more characters functions with rtl/character.hxx
Change-Id: I70f3c31e4b2f44d2b30020a588aaa53d3b63d452
Reviewed-on: https://gerrit.libreoffice.org/4447
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | include/unotools/charclass.hxx | 8 | ||||
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx index 6ea11f62063d..3ff83458b0af 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 afd50e1c8f57..d0ef4addf033 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) ) |