Use rtl::isAscii* instead of ctype.h is* (and fix passing plain char)

Change-Id: Ie37f15379b0e10912ef2e0ac94249da11040eede
This commit is contained in:
Stephan Bergmann
2017-03-23 07:32:58 +01:00
parent 0a92c29e47
commit 0ab2f39e45

View File

@@ -166,9 +166,9 @@ sal_uLong SvTokenStream::GetNumber()
if( nLog == 16 ) if( nLog == 16 )
{ {
while( isxdigit( c ) ) while( rtl::isAsciiHexDigit( static_cast<unsigned char>(c) ) )
{ {
if( isdigit( c ) ) if( rtl::isAsciiDigit( static_cast<unsigned char>(c) ) )
l = l * nLog + (c - '0'); l = l * nLog + (c - '0');
else else
l = l * nLog l = l * nLog
@@ -179,7 +179,7 @@ sal_uLong SvTokenStream::GetNumber()
} }
else else
{ {
while( isdigit( c ) || 'x' == c ) while( rtl::isAsciiDigit( static_cast<unsigned char>(c) ) || 'x' == c )
{ {
l = l * nLog + (c - '0'); l = l * nLog + (c - '0');
c = GetFastNextChar(); c = GetFastNextChar();
@@ -196,7 +196,8 @@ bool SvTokenStream::MakeToken( SvToken & rToken )
if( 0 == c ) if( 0 == c )
c = GetNextChar(); c = GetNextChar();
// skip whitespace // skip whitespace
while( isspace( c ) || 26 == c ) while( rtl::isAsciiWhiteSpace( static_cast<unsigned char>(c) )
|| 26 == c )
{ {
c = GetFastNextChar(); c = GetFastNextChar();
nColumn += c == '\t' ? nTabSize : 1; nColumn += c == '\t' ? nTabSize : 1;
@@ -280,16 +281,17 @@ bool SvTokenStream::MakeToken( SvToken & rToken )
rToken.nType = SVTOKENTYPE::String; rToken.nType = SVTOKENTYPE::String;
rToken.aString = aStr.makeStringAndClear(); rToken.aString = aStr.makeStringAndClear();
} }
else if( isdigit( c ) ) else if( rtl::isAsciiDigit( static_cast<unsigned char>(c) ) )
{ {
rToken.nType = SVTOKENTYPE::Integer; rToken.nType = SVTOKENTYPE::Integer;
rToken.nLong = GetNumber(); rToken.nLong = GetNumber();
} }
else if( isalpha (c) || (c == '_') ) else if( rtl::isAsciiAlpha (static_cast<unsigned char>(c)) || (c == '_') )
{ {
OStringBuffer aBuf; OStringBuffer aBuf;
while( isalnum( c ) || c == '_' ) while( rtl::isAsciiAlphanumeric( static_cast<unsigned char>(c) )
|| c == '_' )
{ {
aBuf.append(c); aBuf.append(c);
c = GetFastNextChar(); c = GetFastNextChar();