diff options
author | Arnaud Versini <arnaud.versini@gmail.com> | 2013-04-07 15:54:39 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-04-10 10:43:38 +0200 |
commit | 4976dd85fa6ecc279ac80d86a27636ce64d3a3ac (patch) | |
tree | ec4a2416ca13803d7643953ab36522bf6694c7e5 /basic | |
parent | 5d67919a5810cf05d6fe53dc14f2b1f073c56719 (diff) |
Introduce characters utilities in rtl/character.hxx
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, with slight modifications
to sal/inc/rtl/character.hxx:
* Replaced "#pragma once" with explicit include guard for now.
* Missing includes.
* Cosmetic clean-up.
Change-Id: I94d01cd4e766f92c70f941839a67101fa2c97654
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/sbx/sbxexec.cxx | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx index 905b3a290831..9d34b7f935c1 100644 --- a/basic/source/sbx/sbxexec.cxx +++ b/basic/source/sbx/sbxexec.cxx @@ -20,26 +20,7 @@ #include <tools/errcode.hxx> #include <vcl/svapp.hxx> #include <basic/sbx.hxx> - - - -static bool isAlpha( sal_Unicode c ) -{ - bool bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); - return bRet; -} - -static bool isDigit( sal_Unicode c ) -{ - bool bRet = (c >= '0' && c <= '9'); - return bRet; -} - -static bool isAlphaNumeric( sal_Unicode c ) -{ - bool bRet = isDigit( c ) || isAlpha( c ); - return bRet; -} +#include <rtl/character.hxx> static SbxVariable* Element @@ -72,7 +53,7 @@ static const sal_Unicode* Symbol( const sal_Unicode* p, OUString& rSym ) else { // A symbol had to begin with a alphabetic character or an underline - if( !isAlpha( *p ) && *p != '_' ) + if( !rtl::isAsciiAlpha( *p ) && *p != '_' ) { SbxBase::SetError( SbxERR_SYNTAX ); } @@ -80,7 +61,7 @@ static const sal_Unicode* Symbol( const sal_Unicode* p, OUString& rSym ) { rSym = p; // The it can contain alphabetic characters, numbers or underlines - while( *p && (isAlphaNumeric( *p ) || *p == '_') ) + while( *p && (rtl::isAsciiAlphanumeric( *p ) || *p == '_') ) { p++, nLen++; } @@ -103,7 +84,7 @@ static SbxVariable* QualifiedName SbxVariableRef refVar; const sal_Unicode* p = SkipWhitespace( *ppBuf ); - if( isAlpha( *p ) || *p == '_' || *p == '[' ) + if( rtl::isAsciiAlpha( *p ) || *p == '_' || *p == '[' ) { // Read in the element refVar = Element( pObj, pGbl, &p, t ); @@ -139,8 +120,8 @@ static SbxVariable* Operand { SbxVariableRef refVar( new SbxVariable ); const sal_Unicode* p = SkipWhitespace( *ppBuf ); - if( !bVar && ( isDigit( *p ) - || ( *p == '.' && isDigit( *( p+1 ) ) ) + if( !bVar && ( rtl::isAsciiDigit( *p ) + || ( *p == '.' && rtl::isAsciiDigit( *( p+1 ) ) ) || *p == '-' || *p == '&' ) ) { |