summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/rtl/character.hxx49
-rw-r--r--include/tools/inetmime.hxx125
-rw-r--r--sal/rtl/strtmpl.cxx69
-rw-r--r--svl/source/misc/inettype.cxx4
-rw-r--r--svl/source/misc/urihelper.cxx4
-rw-r--r--sw/source/ui/sidebar/PageSizeControl.cxx4
-rw-r--r--tools/source/fsys/urlobj.cxx16
-rw-r--r--tools/source/inet/inetmime.cxx51
8 files changed, 104 insertions, 218 deletions
diff --git a/include/rtl/character.hxx b/include/rtl/character.hxx
index 01350e19ee78..2218158e7ac7 100644
--- a/include/rtl/character.hxx
+++ b/include/rtl/character.hxx
@@ -139,6 +139,40 @@ inline bool isAsciiHexDigit(sal_uInt32 nUtf32)
return isAsciiCanonicHexDigit(nUtf32) || (nUtf32 >= 'a' && nUtf32 <= 'f');
}
+/** Convert a character, if ASCII, to upper case.
+
+ @param nChar A Unicode scalar value (represented as a UTF-32 code unit).
+
+ @return
+ nChar converted to ASCII upper case
+
+ @since LibreOffice 4.2
+*/
+inline sal_uInt32 toAsciiUpperCase(sal_uInt32 nChar)
+{
+ if( isAsciiLowerCase(nChar) )
+ nChar -= 32;
+
+ return nChar;
+}
+
+/** Convert a character, if ASCII, to lower case.
+
+ @param nChar A Unicode scalar value (represented as a UTF-32 code unit).
+
+ @return
+ nChar converted to ASCII lower case
+
+ @since LibreOffice 4.2
+*/
+inline sal_uInt32 toAsciiLowerCase(sal_uInt32 nChar)
+{
+ if( isAsciiUpperCase(nChar) )
+ nChar += 32;
+
+ return nChar;
+}
+
/** Compare two US-ASCII characters.
@param nChar1 A Unicode scalar value (represented as a UTF-32 code unit).
@@ -146,21 +180,18 @@ inline bool isAsciiHexDigit(sal_uInt32 nUtf32)
@return
0 if both strings are equal
- < 0 - if this string is less than the string argument
- > 0 - if this string is greater than the string argument
+ < 0 - if this nChar1 is less than nChar2 argument
+ > 0 - if this nChar1 is greater than the nChar2 argument
@since LibreOffice 4.2
*/
inline sal_Int32 compareAsciiIgnoreCase(sal_uInt32 nChar1, sal_uInt32 nChar2)
{
- assert(isAscii(nChar1) && isAscii(nChar2));
- if ( isAsciiUpperCase(nChar1) )
- nChar1 += 32;
- if ( isAsciiUpperCase(nChar2) )
- nChar2 += 32;
- return nChar1 - nChar2;
-}
+ nChar1 = toAsciiLowerCase(nChar1);
+ nChar2 = toAsciiLowerCase(nChar2);
+ return ((sal_Int32) nChar1) - ((sal_Int32) nChar2);
+}
}//rtl namespace
diff --git a/include/tools/inetmime.hxx b/include/tools/inetmime.hxx
index 256f350cb87d..292f7449ba7d 100644
--- a/include/tools/inetmime.hxx
+++ b/include/tools/inetmime.hxx
@@ -137,14 +137,6 @@ public:
HEADER_FIELD_ADDRESS
};
- /** Check for US-ASCII character.
-
- @param nChar Some UCS-4 character.
-
- @return True if nChar is a US-ASCII character (0x00--0x7F).
- */
- static inline bool isUSASCII(sal_uInt32 nChar);
-
/** Check for ISO 8859-1 character.
@param nChar Some UCS-4 character.
@@ -180,69 +172,6 @@ public:
*/
static inline bool isVisible(sal_uInt32 nChar);
- /** Check for US-ASCII digit character.
-
- @param nChar Some UCS-4 character.
-
- @return True if nChar is a US-ASCII (decimal) digit character (US-
- ASCII '0'--'9').
- */
- static inline bool isDigit(sal_uInt32 nChar);
-
- /** Check for US-ASCII canonic hexadecimal digit character.
-
- @param nChar Some UCS-4 character.
-
- @return True if nChar is a US-ASCII canonic (i.e., upper case)
- hexadecimal digit character (US-ASCII '0'--'9' or 'A'--'F').
- */
- static inline bool isCanonicHexDigit(sal_uInt32 nChar);
-
- /** Check for US-ASCII hexadecimal digit character.
-
- @param nChar Some UCS-4 character.
-
- @return True if nChar is a US-ASCII hexadecimal digit character (US-
- ASCII '0'--'9', 'A'--'F', 'a'--'f').
- */
- static inline bool isHexDigit(sal_uInt32 nChar);
-
- /** Check for US-ASCII upper case character.
-
- @param nChar Some UCS-4 character.
-
- @return True if nChar is a US-ASCII upper case alphabetic character
- (US-ASCII 'A'--'Z').
- */
- static inline bool isUpperCase(sal_uInt32 nChar);
-
- /** Check for US-ASCII lower case character.
-
- @param nChar Some UCS-4 character.
-
- @return True if nChar is a US-ASCII lower case alphabetic character
- (US-ASCII 'a'--'z').
- */
- static inline bool isLowerCase(sal_uInt32 nChar);
-
- /** Check for US-ASCII alphabetic character.
-
- @param nChar Some UCS-4 character.
-
- @return True if nChar is a US-ASCII alphabetic character (US-ASCII
- 'A'--'Z' or 'a'--'z').
- */
- static inline bool isAlpha(sal_uInt32 nChar);
-
- /** Check for US-ASCII alphanumeric character.
-
- @param nChar Some UCS-4 character.
-
- @return True if nChar is a US-ASCII alphanumeric character (US-ASCII
- '0'--'9', 'A'--'Z' or 'a'--'z').
- */
- static inline bool isAlphanumeric(sal_uInt32 nChar);
-
/** Check for US-ASCII Base 64 digit character.
@param nChar Some UCS-4 character.
@@ -301,6 +230,7 @@ public:
'A'--'Z'), return the corresponding US-ASCII lower case character (US-
ASCII 'a'--'z'); otherwise, return nChar unchanged.
*/
+ SAL_DEPRECATED("Use rtl::toAsciiUpperCase instead")
static inline sal_uInt32 toUpperCase(sal_uInt32 nChar);
/** Translate an US-ASCII character to lower case.
@@ -311,6 +241,7 @@ public:
'a'--'z'), return the corresponding US-ASCII upper case character (US-
ASCII 'A'--'Z'); otherwise, return nChar unchanged.
*/
+ SAL_DEPRECATED("Use rtl::toAsciiLowerCase instead")
static inline sal_uInt32 toLowerCase(sal_uInt32 nChar);
/** Get the digit weight of a US-ASCII character.
@@ -536,12 +467,6 @@ public:
};
// static
-inline bool INetMIME::isUSASCII(sal_uInt32 nChar)
-{
- return rtl::isAscii(nChar);
-}
-
-// static
inline bool INetMIME::isISO88591(sal_uInt32 nChar)
{
return nChar <= 0xFF;
@@ -566,48 +491,6 @@ inline bool INetMIME::isVisible(sal_uInt32 nChar)
}
// static
-inline bool INetMIME::isDigit(sal_uInt32 nChar)
-{
- return rtl::isAsciiDigit(nChar);
-}
-
-// static
-inline bool INetMIME::isCanonicHexDigit(sal_uInt32 nChar)
-{
- return rtl::isAsciiCanonicHexDigit(nChar);
-}
-
-// static
-inline bool INetMIME::isHexDigit(sal_uInt32 nChar)
-{
- return rtl::isAsciiHexDigit(nChar);
-}
-
-// static
-inline bool INetMIME::isUpperCase(sal_uInt32 nChar)
-{
- return rtl::isAsciiUpperCase(nChar);
-}
-
-// static
-inline bool INetMIME::isLowerCase(sal_uInt32 nChar)
-{
- return rtl::isAsciiLowerCase(nChar);
-}
-
-// static
-inline bool INetMIME::isAlpha(sal_uInt32 nChar)
-{
- return rtl::isAsciiAlpha(nChar);
-}
-
-// static
-inline bool INetMIME::isAlphanumeric(sal_uInt32 nChar)
-{
- return rtl::isAsciiAlphanumeric(nChar);
-}
-
-// static
inline bool INetMIME::isBase64Digit(sal_uInt32 nChar)
{
return rtl::isAsciiUpperCase(nChar) || rtl::isAsciiLowerCase(nChar) || rtl::isAsciiDigit(nChar)
@@ -617,13 +500,13 @@ inline bool INetMIME::isBase64Digit(sal_uInt32 nChar)
// static
inline sal_uInt32 INetMIME::toUpperCase(sal_uInt32 nChar)
{
- return rtl::isAsciiLowerCase(nChar) ? nChar - ('a' - 'A') : nChar;
+ return rtl::toAsciiUpperCase(nChar);
}
// static
inline sal_uInt32 INetMIME::toLowerCase(sal_uInt32 nChar)
{
- return rtl::isAsciiUpperCase(nChar) ? nChar + ('a' - 'A') : nChar;
+ return rtl::toAsciiLowerCase(nChar);
}
// static
diff --git a/sal/rtl/strtmpl.cxx b/sal/rtl/strtmpl.cxx
index 496216f1c86f..48bf05e65e15 100644
--- a/sal/rtl/strtmpl.cxx
+++ b/sal/rtl/strtmpl.cxx
@@ -27,6 +27,7 @@
#include <string.h>
#include <sal/log.hxx>
+#include <rtl/character.hxx>
#include <boost/static_assert.hpp>
/*
@@ -179,10 +180,8 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( compareIgnoreAsciiCase )( const IMPL_RTL_ST
/* If character between 'A' and 'Z', than convert it to lowercase */
c1 = (sal_Int32)IMPL_RTL_USTRCODE( *pStr1 );
c2 = (sal_Int32)IMPL_RTL_USTRCODE( *pStr2 );
- if ( (c1 >= 65) && (c1 <= 90) )
- c1 += 32;
- if ( (c2 >= 65) && (c2 <= 90) )
- c2 += 32;
+ c1 = rtl::toAsciiLowerCase( c1 );
+ c2 = rtl::toAsciiLowerCase( c2 );
nRet = c1-c2;
if ( nRet != 0 )
return nRet;
@@ -205,19 +204,12 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( compareIgnoreAsciiCase_WithLength )( const
{
const IMPL_RTL_STRCODE* pStr1End = pStr1 + nStr1Len;
const IMPL_RTL_STRCODE* pStr2End = pStr2 + nStr2Len;
- sal_Int32 nRet;
- sal_Int32 c1;
- sal_Int32 c2;
+ sal_Int32 nRet;
while ( (pStr1 < pStr1End) && (pStr2 < pStr2End) )
{
- /* If character between 'A' and 'Z', than convert it to lowercase */
- c1 = (sal_Int32)IMPL_RTL_USTRCODE( *pStr1 );
- c2 = (sal_Int32)IMPL_RTL_USTRCODE( *pStr2 );
- if ( (c1 >= 65) && (c1 <= 90) )
- c1 += 32;
- if ( (c2 >= 65) && (c2 <= 90) )
- c2 += 32;
- nRet = c1-c2;
+ sal_uInt32 c1 = IMPL_RTL_USTRCODE( *pStr1 );
+ sal_uInt32 c2 = IMPL_RTL_USTRCODE( *pStr2 );
+ nRet = rtl::compareAsciiIgnoreCase(c1, c2);
if ( nRet != 0 )
return nRet;
@@ -239,20 +231,13 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( shortenedCompareIgnoreAsciiCase_WithLength
{
const IMPL_RTL_STRCODE* pStr1End = pStr1 + nStr1Len;
const IMPL_RTL_STRCODE* pStr2End = pStr2 + nStr2Len;
- sal_Int32 nRet;
- sal_Int32 c1;
- sal_Int32 c2;
+ sal_Int32 nRet;
while ( (nShortenedLength > 0) &&
(pStr1 < pStr1End) && (pStr2 < pStr2End) )
{
- /* If character between 'A' and 'Z', than convert it to lowercase */
- c1 = (sal_Int32)IMPL_RTL_USTRCODE( *pStr1 );
- c2 = (sal_Int32)IMPL_RTL_USTRCODE( *pStr2 );
- if ( (c1 >= 65) && (c1 <= 90) )
- c1 += 32;
- if ( (c2 >= 65) && (c2 <= 90) )
- c2 += 32;
- nRet = c1-c2;
+ sal_uInt32 c1 = IMPL_RTL_USTRCODE( *pStr1 );
+ sal_uInt32 c2 = IMPL_RTL_USTRCODE( *pStr2 );
+ nRet = rtl::compareAsciiIgnoreCase(c1, c2);
if ( nRet != 0 )
return nRet;
@@ -577,9 +562,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiLowerCase )( IMPL_RTL_STRCODE* pStr )
{
while ( *pStr )
{
- /* Between A-Z (65-90), than to lowercase (+32) */
- if ( (*pStr >= 65) && (*pStr <= 90) )
- *pStr += 32;
+ *pStr = rtl::toAsciiLowerCase( *pStr );
pStr++;
}
@@ -593,9 +576,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiLowerCase_WithLength )( IMPL_RTL_STRCODE*
{
while ( nLen > 0 )
{
- /* Between A-Z (65-90), than to lowercase (+32) */
- if ( (*pStr >= 65) && (*pStr <= 90) )
- *pStr += 32;
+ *pStr = rtl::toAsciiLowerCase( *pStr );
pStr++;
nLen--;
@@ -609,9 +590,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiUpperCase )( IMPL_RTL_STRCODE* pStr )
{
while ( *pStr )
{
- /* Between a-z (97-122), than to uppercase (-32) */
- if ( (*pStr >= 97) && (*pStr <= 122) )
- *pStr -= 32;
+ *pStr = rtl::toAsciiUpperCase( *pStr );
pStr++;
}
@@ -625,9 +604,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiUpperCase_WithLength )( IMPL_RTL_STRCODE*
{
while ( nLen > 0 )
{
- /* Between a-z (97-122), than to uppercase (-32) */
- if ( (*pStr >= 97) && (*pStr <= 122) )
- *pStr -= 32;
+ *pStr = rtl::toAsciiUpperCase( *pStr );
pStr++;
nLen--;
@@ -1592,7 +1569,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiLowerCase )( IMPL_RTL_STRINGDATA**
while ( nLen > 0 )
{
/* Between A-Z (65-90), than to lowercase (+32) */
- if ( (*pCharStr >= 65) && (*pCharStr <= 90) )
+ if ( rtl::isAsciiUpperCase(*pCharStr) )
{
/* Copy String */
IMPL_RTL_STRCODE* pNewCharStr = IMPL_RTL_STRINGNAME( ImplNewCopy )( ppThis, pStr, pCharStr-pStr->buffer );
@@ -1608,11 +1585,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiLowerCase )( IMPL_RTL_STRINGDATA**
while ( nLen > 0 )
{
- /* Between A-Z (65-90), than to lowercase (+32) */
- if ( (*pCharStr >= 65) && (*pCharStr <= 90) )
- *pNewCharStr = *pCharStr+32;
- else
- *pNewCharStr = *pCharStr;
+ *pNewCharStr = rtl::toAsciiLowerCase( *pCharStr );
pNewCharStr++;
pCharStr++;
@@ -1654,7 +1627,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiUpperCase )( IMPL_RTL_STRINGDATA**
while ( nLen > 0 )
{
/* Between a-z (97-122), than to uppercase (-32) */
- if ( (*pCharStr >= 97) && (*pCharStr <= 122) )
+ if ( rtl::isAsciiLowerCase(*pCharStr) )
{
/* Copy String */
IMPL_RTL_STRCODE* pNewCharStr = IMPL_RTL_STRINGNAME( ImplNewCopy )( ppThis, pStr, pCharStr-pStr->buffer );
@@ -1670,11 +1643,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiUpperCase )( IMPL_RTL_STRINGDATA**
while ( nLen > 0 )
{
- /* Between a-z (97-122), than to uppercase (-32) */
- if ( (*pCharStr >= 97) && (*pCharStr <= 122) )
- *pNewCharStr = *pCharStr-32;
- else
- *pNewCharStr = *pCharStr;
+ *pNewCharStr = rtl::toAsciiUpperCase( *pCharStr );
pNewCharStr++;
pCharStr++;
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index ba5fea901e41..31c5a754a257 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -850,7 +850,7 @@ bool INetContentTypes::parse(OUString const & rMediaType,
bool bDowncase = false;
while (p != pEnd && INetMIME::isTokenChar(*p))
{
- bDowncase = bDowncase || INetMIME::isUpperCase(*p);
+ bDowncase = bDowncase || rtl::isAsciiUpperCase(*p);
++p;
}
if (p == pToken)
@@ -868,7 +868,7 @@ bool INetContentTypes::parse(OUString const & rMediaType,
bDowncase = false;
while (p != pEnd && INetMIME::isTokenChar(*p))
{
- bDowncase = bDowncase || INetMIME::isUpperCase(*p);
+ bDowncase = bDowncase || rtl::isAsciiUpperCase(*p);
++p;
}
if (p == pToken)
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index 811f37fab813..32df0b69748a 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -360,7 +360,7 @@ bool checkWChar(CharClass const & rCharClass, OUString const & rStr,
bool bPipe = false)
{
sal_Unicode c = rStr[*pPos];
- if (INetMIME::isUSASCII(c))
+ if (rtl::isAscii(c))
{
static sal_uInt8 const aMap[128]
= { 0, 0, 0, 0, 0, 0, 0, 0,
@@ -515,7 +515,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText,
sal_Unicode c = rText[nPos];
if (bBoundary1)
{
- if (INetMIME::isAlpha(c))
+ if (rtl::isAsciiAlpha(c))
{
sal_Int32 i = nPos;
INetProtocol eScheme = INetURLObject::CompareProtocolScheme(rText.copy(i, rEnd - i));
diff --git a/sw/source/ui/sidebar/PageSizeControl.cxx b/sw/source/ui/sidebar/PageSizeControl.cxx
index 1c507bf61ed0..f913d8f725a0 100644
--- a/sw/source/ui/sidebar/PageSizeControl.cxx
+++ b/sw/source/ui/sidebar/PageSizeControl.cxx
@@ -26,7 +26,7 @@
#include <svx/sidebar/ValueSetWithTextControl.hxx>
-#include <tools/inetmime.hxx>
+#include <rtl/character.hxx>
#include <editeng/paperinf.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
@@ -71,7 +71,7 @@ PageSizeControl::PageSizeControl(
for (short i = aText.getLength() - 1; i >= 0; i--)
{
sal_Unicode c = aText[i];
- if ( INetMIME::isAlpha(c) || (c == '\'') || (c == '\"') || (c == '%') )
+ if ( rtl::isAsciiAlpha(c) || (c == '\'') || (c == '\"') || (c == '%') )
{
aMetricStr = OUString(c) + aMetricStr;
}
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index fee81b76ff15..c1bb3cc60127 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -30,6 +30,8 @@
#include "rtl/ustring.hxx"
#include "sal/types.h"
+#include <rtl/character.hxx>
+
#include <algorithm>
#include <limits>
@@ -562,7 +564,7 @@ static sal_uInt32 const aMustEncodeMap[128]
inline bool mustEncode(sal_uInt32 nUTF32, INetURLObject::Part ePart)
{
- return !INetMIME::isUSASCII(nUTF32) || !(aMustEncodeMap[nUTF32] & ePart);
+ return !rtl::isAscii(nUTF32) || !(aMustEncodeMap[nUTF32] & ePart);
}
}
@@ -2209,7 +2211,7 @@ INetURLObject::PrefixInfo const * INetURLObject::getPrefix(sal_Unicode const *&
}
if (p >= pEnd)
break;
- sal_uInt32 nChar = INetMIME::toLowerCase(*p++);
+ sal_uInt32 nChar = rtl::toAsciiLowerCase(*p++);
while (pFirst <= pLast && sal_uChar(pFirst->m_pPrefix[i]) < nChar)
++pFirst;
while (pFirst <= pLast && sal_uChar(pLast->m_pPrefix[i]) > nChar)
@@ -2219,7 +2221,7 @@ INetURLObject::PrefixInfo const * INetURLObject::getPrefix(sal_Unicode const *&
{
sal_Char const * q = pFirst->m_pPrefix + i;
while (p < pEnd && *q != '\0'
- && INetMIME::toLowerCase(*p) == sal_uChar(*q))
+ && rtl::toAsciiLowerCase(*p) == sal_uChar(*q))
{
++p;
++q;
@@ -3229,7 +3231,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
eCharset, eEscapeType);
appendUCS4(aTheSynPath,
eEscapeType == ESCAPE_NO ?
- INetMIME::toLowerCase(nUTF32) : nUTF32,
+ rtl::toAsciiLowerCase(nUTF32) : nUTF32,
eEscapeType, bOctets, PART_VIM, '=',
eCharset, false);
}
@@ -3685,7 +3687,7 @@ OUString INetURLObject::decode(sal_Unicode const * pBegin,
case ESCAPE_UTF32:
if (
- INetMIME::isUSASCII(nUTF32) &&
+ rtl::isAscii(nUTF32) &&
(
eMechanism == DECODE_TO_IURI ||
(
@@ -5062,7 +5064,7 @@ sal_uInt32 INetURLObject::getUTF32(sal_Unicode const *& rBegin,
OSL_FAIL(
"INetURLObject::getUTF32(): Unsupported charset");
case RTL_TEXTENCODING_ASCII_US:
- rEscapeType = INetMIME::isUSASCII(nUTF32) ?
+ rEscapeType = rtl::isAscii(nUTF32) ?
ESCAPE_UTF32 : ESCAPE_OCTET;
break;
@@ -5071,7 +5073,7 @@ sal_uInt32 INetURLObject::getUTF32(sal_Unicode const *& rBegin,
break;
case RTL_TEXTENCODING_UTF8:
- if (INetMIME::isUSASCII(nUTF32))
+ if (rtl::isAscii(nUTF32))
rEscapeType = ESCAPE_UTF32;
else
{
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx
index 3e11ca943095..2152c900fbac 100644
--- a/tools/source/inet/inetmime.cxx
+++ b/tools/source/inet/inetmime.cxx
@@ -24,6 +24,7 @@
#include <rtl/strbuf.hxx>
#include <rtl/tencinfo.h>
#include <tools/inetmime.hxx>
+#include <rtl/character.hxx>
namespace unnamed_tools_inetmime {} using namespace unnamed_tools_inetmime;
// unnamed namespaces don't work well yet
@@ -368,7 +369,7 @@ bool INetMIME::isAtomChar(sal_uInt32 nChar)
true, true, true, true, true, true, true, true, //pqrstuvw
true, true, true, true, true, true, true, false //xyz{|}~
};
- return isUSASCII(nChar) && aMap[nChar];
+ return rtl::isAscii(nChar) && aMap[nChar];
}
// static
@@ -392,7 +393,7 @@ bool INetMIME::isTokenChar(sal_uInt32 nChar)
true, true, true, true, true, true, true, true, //pqrstuvw
true, true, true, true, true, true, true, false //xyz{|}~
};
- return isUSASCII(nChar) && aMap[nChar];
+ return rtl::isAscii(nChar) && aMap[nChar];
}
// static
@@ -416,7 +417,7 @@ bool INetMIME::isEncodedWordTokenChar(sal_uInt32 nChar)
true, true, true, true, true, true, true, true, //pqrstuvw
true, true, true, true, true, true, true, false //xyz{|}~
};
- return isUSASCII(nChar) && aMap[nChar];
+ return rtl::isAscii(nChar) && aMap[nChar];
}
// static
@@ -440,7 +441,7 @@ bool INetMIME::isIMAPAtomChar(sal_uInt32 nChar)
true, true, true, true, true, true, true, true, //pqrstuvw
true, true, true, false, true, true, true, false //xyz{|}~
};
- return isUSASCII(nChar) && aMap[nChar];
+ return rtl::isAscii(nChar) && aMap[nChar];
}
// static
@@ -465,7 +466,7 @@ bool INetMIME::equalIgnoreCase(const sal_Char * pBegin1,
while (*pString2 != 0)
if (pBegin1 == pEnd1
- || toUpperCase(*pBegin1++) != toUpperCase(*pString2++))
+ || rtl::toAsciiUpperCase(*pBegin1++) != rtl::toAsciiUpperCase(*pString2++))
return false;
return pBegin1 == pEnd1;
}
@@ -480,7 +481,7 @@ bool INetMIME::equalIgnoreCase(const sal_Unicode * pBegin1,
while (*pString2 != 0)
if (pBegin1 == pEnd1
- || toUpperCase(*pBegin1++) != toUpperCase(*pString2++))
+ || rtl::toAsciiUpperCase(*pBegin1++) != rtl::toAsciiUpperCase(*pString2++))
return false;
return pBegin1 == pEnd1;
}
@@ -725,7 +726,7 @@ const sal_Unicode * INetMIME::scanQuotedBlock(const sal_Unicode * pBegin,
default:
++rLength;
- if (!isUSASCII(c))
+ if (!rtl::isAscii(c))
rModify = true;
break;
}
@@ -755,7 +756,7 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin,
bool bDowncaseAttribute = false;
while (p != pEnd && isTokenChar(*p) && *p != '*')
{
- bDowncaseAttribute = bDowncaseAttribute || isUpperCase(*p);
+ bDowncaseAttribute = bDowncaseAttribute || rtl::isAsciiUpperCase(*p);
++p;
}
if (p == pAttributeBegin)
@@ -770,7 +771,7 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin,
if (p != pEnd && *p == '*')
{
++p;
- if (p != pEnd && isDigit(*p)
+ if (p != pEnd && rtl::isAsciiDigit(*p)
&& !scanUnsigned(p, pEnd, false, nSection))
break;
}
@@ -805,7 +806,7 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin,
bool bDowncaseCharset = false;
while (p != pEnd && isTokenChar(*p) && *p != '\'')
{
- bDowncaseCharset = bDowncaseCharset || isUpperCase(*p);
+ bDowncaseCharset = bDowncaseCharset || rtl::isAsciiUpperCase(*p);
++p;
}
if (p == pCharsetBegin)
@@ -828,12 +829,12 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin,
bool bDowncaseLanguage = false;
int nLetters = 0;
for (; p != pEnd; ++p)
- if (isAlpha(*p))
+ if (rtl::isAsciiAlpha(*p))
{
if (++nLetters > 8)
break;
bDowncaseLanguage = bDowncaseLanguage
- || isUpperCase(*p);
+ || rtl::isAsciiUpperCase(*p);
}
else if (*p == '-')
{
@@ -866,7 +867,7 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin,
while (p != pEnd)
{
sal_uInt32 nChar = INetMIME::getUTF32Character(p, pEnd);
- if (isUSASCII(nChar) && !isTokenChar(nChar))
+ if (rtl::isAscii(nChar) && !isTokenChar(nChar))
break;
if (nChar == '%' && p + 1 < pEnd)
{
@@ -884,7 +885,7 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin,
aValue = aSink.takeBuffer();
}
else
- while (p != pEnd && (isTokenChar(*p) || !isUSASCII(*p)))
+ while (p != pEnd && (isTokenChar(*p) || !rtl::isAscii(*p)))
++p;
}
else if (p != pEnd && *p == '"')
@@ -938,7 +939,7 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin,
else
{
sal_Unicode const * pTokenBegin = p;
- while (p != pEnd && (isTokenChar(*p) || !isUSASCII(*p)))
+ while (p != pEnd && (isTokenChar(*p) || !rtl::isAscii(*p)))
++p;
if (p == pTokenBegin)
break;
@@ -1777,7 +1778,7 @@ void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink,
break;
default:
- if (isUSASCII(*pBodyPtr)
+ if (rtl::isAscii(*pBodyPtr)
&& !isAtomChar(*pBodyPtr))
{
eEntity = ENTITY_JUNK;
@@ -1826,7 +1827,7 @@ void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink,
else
while (pLookAhead != pBodyEnd
&& (isAtomChar(*pLookAhead)
- || !isUSASCII(
+ || !rtl::isAscii(
*pLookAhead)))
++pLookAhead;
while (pLookAhead != pBodyEnd)
@@ -1890,7 +1891,7 @@ void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink,
// whole entity is 'junk' rather than 'non-
// phrase':
if (eEntity == ENTITY_NON_PHRASE
- && !isUSASCII(*pBodyPtr))
+ && !rtl::isAscii(*pBodyPtr))
eEntity = ENTITY_JUNK;
break;
}
@@ -1947,7 +1948,7 @@ void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink,
default:
if (isVisible(*pBodyPtr))
bEnd = true;
- else if (isUSASCII(*pBodyPtr))
+ else if (rtl::isAscii(*pBodyPtr))
{
++nLength;
++pBodyPtr;
@@ -2090,7 +2091,7 @@ void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink,
}
else
{
- if (!isUSASCII(*pBodyPtr))
+ if (!rtl::isAscii(*pBodyPtr))
bModify = true;
bEnd = true;
}
@@ -2238,7 +2239,7 @@ void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink,
pBodyPtr, pBodyEnd);
if (pLookAhead != pBodyEnd
&& (isAtomChar(*pLookAhead)
- || !isUSASCII(*pLookAhead)
+ || !rtl::isAscii(*pLookAhead)
|| *pLookAhead == '"'))
pBodyPtr = pLookAhead;
else
@@ -2264,7 +2265,7 @@ void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink,
default:
if (bQuotedString
|| isAtomChar(*pBodyPtr)
- || !isUSASCII(*pBodyPtr))
+ || !rtl::isAscii(*pBodyPtr))
++pBodyPtr;
else
bEnd = true;
@@ -2483,7 +2484,7 @@ OUString INetMIME::decodeHeaderFieldBody(HeaderFieldType eType,
default:
if (pLanguageBegin != 0
- && (!isAlpha(cChar) || ++nAlphaCount > 8))
+ && (!rtl::isAsciiAlpha(cChar) || ++nAlphaCount > 8))
pLanguageBegin = 0;
break;
}
@@ -3011,7 +3012,7 @@ static const sal_Char aEscape[128]
inline bool
INetMIMEEncodedWordOutputSink::needsEncodedWordEscape(sal_uInt32 nChar) const
{
- return !INetMIME::isUSASCII(nChar) || aEscape[nChar] & m_eContext;
+ return !rtl::isAscii(nChar) || aEscape[nChar] & m_eContext;
}
void INetMIMEEncodedWordOutputSink::finish(bool bWriteTrailer)
@@ -3698,7 +3699,7 @@ INetMIMEEncodedWordOutputSink::operator <<(sal_uInt32 nChar)
0, // '}'
0, // '~'
TENQ | CENQ | PENQ }; // DEL
- Coding eNewCoding = !INetMIME::isUSASCII(nChar) ? CODING_ENCODED :
+ Coding eNewCoding = !rtl::isAscii(nChar) ? CODING_ENCODED :
m_eContext == CONTEXT_PHRASE ?
Coding(aMinimal[nChar] >> 2) :
aMinimal[nChar] & m_eContext ? CODING_ENCODED :