summaryrefslogtreecommitdiff
path: root/sw/source/filter/html
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-08-29 00:36:22 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-08-29 09:56:08 +0100
commit3829892dbc5475a49250729541be369ea9532d28 (patch)
tree9a57bc4865772c6613db2c71c6fde609d8563e09 /sw/source/filter/html
parentde82a40f84c69081a517617989c344ec9597cb45 (diff)
merge together 5 or ascii isalpha/isalnum/isdigit implementations
Diffstat (limited to 'sw/source/filter/html')
-rw-r--r--sw/source/filter/html/parcss1.cxx35
1 files changed, 11 insertions, 24 deletions
diff --git a/sw/source/filter/html/parcss1.cxx b/sw/source/filter/html/parcss1.cxx
index 635695255984..cb3a376222f4 100644
--- a/sw/source/filter/html/parcss1.cxx
+++ b/sw/source/filter/html/parcss1.cxx
@@ -36,7 +36,7 @@
#include <rtl/ustrbuf.hxx>
#include <vcl/svapp.hxx>
#include <svtools/htmltokn.h>
-
+#include <comphelper/string.hxx>
#include "css1kywd.hxx"
#include "parcss1.hxx"
@@ -157,18 +157,15 @@ CSS1Token CSS1Parser::GetNextToken()
case '@': // '@import' | '@XXX'
{
cNextCh = GetNextChar();
- if( ('A' <= cNextCh && cNextCh <= 'Z') ||
- ('a' <= cNextCh && cNextCh <= 'z') )
+ if (comphelper::string::isalphaAscii(cNextCh))
{
// den naechsten Identifer scannen
::rtl::OUStringBuffer sTmpBuffer( 32L );
do {
sTmpBuffer.append( cNextCh );
cNextCh = GetNextChar();
- } while( ('A' <= cNextCh && cNextCh <= 'Z') ||
- ('a' <= cNextCh && cNextCh <= 'z') ||
- ('0' <= cNextCh && cNextCh <= '9') ||
- ('-'==cNextCh && !IsEOF()) );
+ } while( (comphelper::string::isalnumAscii(cNextCh) ||
+ '-' == cNextCh) && !IsEOF() );
aToken += String(sTmpBuffer.makeStringAndClear());
@@ -263,10 +260,8 @@ CSS1Token CSS1Parser::GetNextToken()
do {
sTmpBuffer.append( cNextCh );
cNextCh = GetNextChar();
- } while( ('A' <= cNextCh && cNextCh <= 'Z') ||
- ('a' <= cNextCh && cNextCh <= 'z') ||
- ('0' <= cNextCh && cNextCh <= '9') ||
- ('-' == cNextCh && !IsEOF()) );
+ } while( (comphelper::string::isalnumAscii(cNextCh) ||
+ '-' == cNextCh) && !IsEOF() );
aToken += String(sTmpBuffer.makeStringAndClear());
@@ -409,10 +404,8 @@ CSS1Token CSS1Parser::GetNextToken()
do {
sTmpBuffer2.append( cNextCh );
cNextCh = GetNextChar();
- } while( ( ('A' <= cNextCh && cNextCh <= 'Z') ||
- ('a' <= cNextCh && cNextCh <= 'z') ||
- ('0' <= cNextCh && cNextCh <= '9') ||
- '-'==cNextCh) && !IsEOF() );
+ } while( (comphelper::string::isalnumAscii(cNextCh) ||
+ '-' == cNextCh) && !IsEOF() );
aIdent += String(sTmpBuffer2.makeStringAndClear());
@@ -606,9 +599,7 @@ CSS1Token CSS1Parser::GetNextToken()
// kein break;
default: // IDENT | syntax error
- // TODO IsAlpha
- if( ('A' <= cNextCh && cNextCh <= 'Z') ||
- ('a' <= cNextCh && cNextCh <= 'z') )
+ if (comphelper::string::isalphaAscii(cNextCh))
{
// IDENT
@@ -626,12 +617,8 @@ CSS1Token CSS1Parser::GetNextToken()
('a'<=cNextCh && 'f'>=cNextCh) );
}
cNextCh = GetNextChar();
- // TODO: AlphaNumeric
- } while( ( ('0'<=cNextCh && '9'>=cNextCh) ||
- ('A'<=cNextCh && 'Z'>=cNextCh) ||
- ('a'<=cNextCh && 'z'>=cNextCh) ||
- '-'==cNextCh ) &&
- !IsEOF() );
+ } while( (comphelper::string::isalnumAscii(cNextCh) ||
+ '-' == cNextCh) && !IsEOF() );
aToken += String(sTmpBuffer.makeStringAndClear());