diff options
author | Arnaud Versini <arnaud.versini@gmail.com> | 2016-08-07 21:47:59 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-08-09 06:26:50 +0000 |
commit | a22328eea392aeeb0d0cbe7492ce185a36777da1 (patch) | |
tree | 9fc93c928108b92b49a58c4b902a0223483447e8 /basic | |
parent | bc611f3373030082a8da518239cbfc1b58b25535 (diff) |
BASIC: Use rtl/character.hxx in basic/source/sbx/sbxscan.cxx
Change-Id: I018bc2881bca1973ef5e5133f3954252d5cea65e
Reviewed-on: https://gerrit.libreoffice.org/27993
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/sbx/sbxscan.cxx | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index cc864ec9f42f..de98ad1b08ec 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -45,6 +45,7 @@ #include "runtime.hxx" #include <rtl/strbuf.hxx> +#include <rtl/character.hxx> #include <svl/zforlist.hxx> #include <comphelper/processfactory.hxx> @@ -57,10 +58,6 @@ void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep ) rcThousandSep = rData.getNumThousandSep()[0]; } -inline bool ImpIsDigit( sal_Unicode c ) -{ - return '0' <= c && c <= '9'; -} /** NOTE: slightly differs from strchr() in that it does not consider the terminating NULL character to be part of the string and returns bool @@ -78,10 +75,6 @@ bool ImpStrChr( const sal_Unicode* p, sal_Unicode c ) return false; } -bool ImpIsAlNum( sal_Unicode c ) -{ - return c < 128 && isalnum( static_cast<char>(c) ); -} // scanning a string according to BASIC-conventions // but exponent may also be a D, so data type is SbxDOUBLE @@ -118,8 +111,8 @@ SbxError ImpScan( const OUString& rWSrc, double& nVal, SbxDataType& rType, p++; bMinus = true; } - if( ImpIsDigit( *p ) || ((*p == cNonIntntlDecSep || *p == cIntntlDecSep || - (cIntntlDecSep && *p == cIntntlGrpSep)) && ImpIsDigit( *(p+1) ))) + if( rtl::isAsciiDigit( *p ) || ((*p == cNonIntntlDecSep || *p == cIntntlDecSep || + (cIntntlDecSep && *p == cIntntlGrpSep)) && rtl::isAsciiDigit( *(p+1) ))) { short exp = 0; short decsep = 0; @@ -229,7 +222,7 @@ SbxError ImpScan( const OUString& rWSrc, double& nVal, SbxDataType& rType, bRes = false; } const sal_Unicode* const pCmp = aCmp.getStr(); - while( ImpIsAlNum( *p ) ) /* XXX: really munge all alnum also when error? */ + while( rtl::isAsciiAlphanumeric( *p ) ) /* XXX: really munge all alnum also when error? */ { sal_Unicode ch = *p; if( ImpStrChr( pCmp, ch ) ) |