Kaydet (Commit) 89de6ba4 authored tarafından Arnaud Versini's avatar Arnaud Versini Kaydeden (comit) Stephan Bergmann

Introduce ASCII case conversion and use more/rtl/character.hxx.

Also remove all others implementations.

Change-Id: I1dc108a9103f087bd8ce591dff2ac5dd254746f8
Signed-off-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst c1df0ce0
...@@ -139,6 +139,40 @@ inline bool isAsciiHexDigit(sal_uInt32 nUtf32) ...@@ -139,6 +139,40 @@ inline bool isAsciiHexDigit(sal_uInt32 nUtf32)
return isAsciiCanonicHexDigit(nUtf32) || (nUtf32 >= 'a' && nUtf32 <= 'f'); 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. /** Compare two US-ASCII characters.
@param nChar1 A Unicode scalar value (represented as a UTF-32 code unit). @param nChar1 A Unicode scalar value (represented as a UTF-32 code unit).
...@@ -146,21 +180,18 @@ inline bool isAsciiHexDigit(sal_uInt32 nUtf32) ...@@ -146,21 +180,18 @@ inline bool isAsciiHexDigit(sal_uInt32 nUtf32)
@return @return
0 if both strings are equal 0 if both strings are equal
< 0 - if this string is less than the string argument < 0 - if this nChar1 is less than nChar2 argument
> 0 - if this string is greater than the string argument > 0 - if this nChar1 is greater than the nChar2 argument
@since LibreOffice 4.2 @since LibreOffice 4.2
*/ */
inline sal_Int32 compareAsciiIgnoreCase(sal_uInt32 nChar1, sal_uInt32 nChar2) inline sal_Int32 compareAsciiIgnoreCase(sal_uInt32 nChar1, sal_uInt32 nChar2)
{ {
assert(isAscii(nChar1) && isAscii(nChar2)); nChar1 = toAsciiLowerCase(nChar1);
if ( isAsciiUpperCase(nChar1) ) nChar2 = toAsciiLowerCase(nChar2);
nChar1 += 32;
if ( isAsciiUpperCase(nChar2) )
nChar2 += 32;
return nChar1 - nChar2;
}
return ((sal_Int32) nChar1) - ((sal_Int32) nChar2);
}
}//rtl namespace }//rtl namespace
......
...@@ -137,14 +137,6 @@ public: ...@@ -137,14 +137,6 @@ public:
HEADER_FIELD_ADDRESS 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. /** Check for ISO 8859-1 character.
@param nChar Some UCS-4 character. @param nChar Some UCS-4 character.
...@@ -180,69 +172,6 @@ public: ...@@ -180,69 +172,6 @@ public:
*/ */
static inline bool isVisible(sal_uInt32 nChar); 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. /** Check for US-ASCII Base 64 digit character.
@param nChar Some UCS-4 character. @param nChar Some UCS-4 character.
...@@ -301,6 +230,7 @@ public: ...@@ -301,6 +230,7 @@ public:
'A'--'Z'), return the corresponding US-ASCII lower case character (US- 'A'--'Z'), return the corresponding US-ASCII lower case character (US-
ASCII 'a'--'z'); otherwise, return nChar unchanged. ASCII 'a'--'z'); otherwise, return nChar unchanged.
*/ */
SAL_DEPRECATED("Use rtl::toAsciiUpperCase instead")
static inline sal_uInt32 toUpperCase(sal_uInt32 nChar); static inline sal_uInt32 toUpperCase(sal_uInt32 nChar);
/** Translate an US-ASCII character to lower case. /** Translate an US-ASCII character to lower case.
...@@ -311,6 +241,7 @@ public: ...@@ -311,6 +241,7 @@ public:
'a'--'z'), return the corresponding US-ASCII upper case character (US- 'a'--'z'), return the corresponding US-ASCII upper case character (US-
ASCII 'A'--'Z'); otherwise, return nChar unchanged. ASCII 'A'--'Z'); otherwise, return nChar unchanged.
*/ */
SAL_DEPRECATED("Use rtl::toAsciiLowerCase instead")
static inline sal_uInt32 toLowerCase(sal_uInt32 nChar); static inline sal_uInt32 toLowerCase(sal_uInt32 nChar);
/** Get the digit weight of a US-ASCII character. /** Get the digit weight of a US-ASCII character.
...@@ -535,12 +466,6 @@ public: ...@@ -535,12 +466,6 @@ public:
sal_uInt32 nUTF32); sal_uInt32 nUTF32);
}; };
// static
inline bool INetMIME::isUSASCII(sal_uInt32 nChar)
{
return rtl::isAscii(nChar);
}
// static // static
inline bool INetMIME::isISO88591(sal_uInt32 nChar) inline bool INetMIME::isISO88591(sal_uInt32 nChar)
{ {
...@@ -565,48 +490,6 @@ inline bool INetMIME::isVisible(sal_uInt32 nChar) ...@@ -565,48 +490,6 @@ inline bool INetMIME::isVisible(sal_uInt32 nChar)
return nChar >= '!' && nChar <= '~'; return nChar >= '!' && 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 // static
inline bool INetMIME::isBase64Digit(sal_uInt32 nChar) inline bool INetMIME::isBase64Digit(sal_uInt32 nChar)
{ {
...@@ -617,13 +500,13 @@ inline bool INetMIME::isBase64Digit(sal_uInt32 nChar) ...@@ -617,13 +500,13 @@ inline bool INetMIME::isBase64Digit(sal_uInt32 nChar)
// static // static
inline sal_uInt32 INetMIME::toUpperCase(sal_uInt32 nChar) inline sal_uInt32 INetMIME::toUpperCase(sal_uInt32 nChar)
{ {
return rtl::isAsciiLowerCase(nChar) ? nChar - ('a' - 'A') : nChar; return rtl::toAsciiUpperCase(nChar);
} }
// static // static
inline sal_uInt32 INetMIME::toLowerCase(sal_uInt32 nChar) inline sal_uInt32 INetMIME::toLowerCase(sal_uInt32 nChar)
{ {
return rtl::isAsciiUpperCase(nChar) ? nChar + ('a' - 'A') : nChar; return rtl::toAsciiLowerCase(nChar);
} }
// static // static
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <string.h> #include <string.h>
#include <sal/log.hxx> #include <sal/log.hxx>
#include <rtl/character.hxx>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
/* /*
...@@ -179,10 +180,8 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( compareIgnoreAsciiCase )( const IMPL_RTL_ST ...@@ -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 */ /* If character between 'A' and 'Z', than convert it to lowercase */
c1 = (sal_Int32)IMPL_RTL_USTRCODE( *pStr1 ); c1 = (sal_Int32)IMPL_RTL_USTRCODE( *pStr1 );
c2 = (sal_Int32)IMPL_RTL_USTRCODE( *pStr2 ); c2 = (sal_Int32)IMPL_RTL_USTRCODE( *pStr2 );
if ( (c1 >= 65) && (c1 <= 90) ) c1 = rtl::toAsciiLowerCase( c1 );
c1 += 32; c2 = rtl::toAsciiLowerCase( c2 );
if ( (c2 >= 65) && (c2 <= 90) )
c2 += 32;
nRet = c1-c2; nRet = c1-c2;
if ( nRet != 0 ) if ( nRet != 0 )
return nRet; return nRet;
...@@ -205,19 +204,12 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( compareIgnoreAsciiCase_WithLength )( const ...@@ -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* pStr1End = pStr1 + nStr1Len;
const IMPL_RTL_STRCODE* pStr2End = pStr2 + nStr2Len; const IMPL_RTL_STRCODE* pStr2End = pStr2 + nStr2Len;
sal_Int32 nRet; sal_Int32 nRet;
sal_Int32 c1;
sal_Int32 c2;
while ( (pStr1 < pStr1End) && (pStr2 < pStr2End) ) while ( (pStr1 < pStr1End) && (pStr2 < pStr2End) )
{ {
/* If character between 'A' and 'Z', than convert it to lowercase */ sal_uInt32 c1 = IMPL_RTL_USTRCODE( *pStr1 );
c1 = (sal_Int32)IMPL_RTL_USTRCODE( *pStr1 ); sal_uInt32 c2 = IMPL_RTL_USTRCODE( *pStr2 );
c2 = (sal_Int32)IMPL_RTL_USTRCODE( *pStr2 ); nRet = rtl::compareAsciiIgnoreCase(c1, c2);
if ( (c1 >= 65) && (c1 <= 90) )
c1 += 32;
if ( (c2 >= 65) && (c2 <= 90) )
c2 += 32;
nRet = c1-c2;
if ( nRet != 0 ) if ( nRet != 0 )
return nRet; return nRet;
...@@ -239,20 +231,13 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( shortenedCompareIgnoreAsciiCase_WithLength ...@@ -239,20 +231,13 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( shortenedCompareIgnoreAsciiCase_WithLength
{ {
const IMPL_RTL_STRCODE* pStr1End = pStr1 + nStr1Len; const IMPL_RTL_STRCODE* pStr1End = pStr1 + nStr1Len;
const IMPL_RTL_STRCODE* pStr2End = pStr2 + nStr2Len; const IMPL_RTL_STRCODE* pStr2End = pStr2 + nStr2Len;
sal_Int32 nRet; sal_Int32 nRet;
sal_Int32 c1;
sal_Int32 c2;
while ( (nShortenedLength > 0) && while ( (nShortenedLength > 0) &&
(pStr1 < pStr1End) && (pStr2 < pStr2End) ) (pStr1 < pStr1End) && (pStr2 < pStr2End) )
{ {
/* If character between 'A' and 'Z', than convert it to lowercase */ sal_uInt32 c1 = IMPL_RTL_USTRCODE( *pStr1 );
c1 = (sal_Int32)IMPL_RTL_USTRCODE( *pStr1 ); sal_uInt32 c2 = IMPL_RTL_USTRCODE( *pStr2 );
c2 = (sal_Int32)IMPL_RTL_USTRCODE( *pStr2 ); nRet = rtl::compareAsciiIgnoreCase(c1, c2);
if ( (c1 >= 65) && (c1 <= 90) )
c1 += 32;
if ( (c2 >= 65) && (c2 <= 90) )
c2 += 32;
nRet = c1-c2;
if ( nRet != 0 ) if ( nRet != 0 )
return nRet; return nRet;
...@@ -577,9 +562,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiLowerCase )( IMPL_RTL_STRCODE* pStr ) ...@@ -577,9 +562,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiLowerCase )( IMPL_RTL_STRCODE* pStr )
{ {
while ( *pStr ) while ( *pStr )
{ {
/* Between A-Z (65-90), than to lowercase (+32) */ *pStr = rtl::toAsciiLowerCase( *pStr );
if ( (*pStr >= 65) && (*pStr <= 90) )
*pStr += 32;
pStr++; pStr++;
} }
...@@ -593,9 +576,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiLowerCase_WithLength )( IMPL_RTL_STRCODE* ...@@ -593,9 +576,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiLowerCase_WithLength )( IMPL_RTL_STRCODE*
{ {
while ( nLen > 0 ) while ( nLen > 0 )
{ {
/* Between A-Z (65-90), than to lowercase (+32) */ *pStr = rtl::toAsciiLowerCase( *pStr );
if ( (*pStr >= 65) && (*pStr <= 90) )
*pStr += 32;
pStr++; pStr++;
nLen--; nLen--;
...@@ -609,9 +590,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiUpperCase )( IMPL_RTL_STRCODE* pStr ) ...@@ -609,9 +590,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiUpperCase )( IMPL_RTL_STRCODE* pStr )
{ {
while ( *pStr ) while ( *pStr )
{ {
/* Between a-z (97-122), than to uppercase (-32) */ *pStr = rtl::toAsciiUpperCase( *pStr );
if ( (*pStr >= 97) && (*pStr <= 122) )
*pStr -= 32;
pStr++; pStr++;
} }
...@@ -625,9 +604,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiUpperCase_WithLength )( IMPL_RTL_STRCODE* ...@@ -625,9 +604,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiUpperCase_WithLength )( IMPL_RTL_STRCODE*
{ {
while ( nLen > 0 ) while ( nLen > 0 )
{ {
/* Between a-z (97-122), than to uppercase (-32) */ *pStr = rtl::toAsciiUpperCase( *pStr );
if ( (*pStr >= 97) && (*pStr <= 122) )
*pStr -= 32;
pStr++; pStr++;
nLen--; nLen--;
...@@ -1592,7 +1569,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiLowerCase )( IMPL_RTL_STRINGDATA** ...@@ -1592,7 +1569,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiLowerCase )( IMPL_RTL_STRINGDATA**
while ( nLen > 0 ) while ( nLen > 0 )
{ {
/* Between A-Z (65-90), than to lowercase (+32) */ /* Between A-Z (65-90), than to lowercase (+32) */
if ( (*pCharStr >= 65) && (*pCharStr <= 90) ) if ( rtl::isAsciiUpperCase(*pCharStr) )
{ {
/* Copy String */ /* Copy String */
IMPL_RTL_STRCODE* pNewCharStr = IMPL_RTL_STRINGNAME( ImplNewCopy )( ppThis, pStr, pCharStr-pStr->buffer ); 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** ...@@ -1608,11 +1585,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiLowerCase )( IMPL_RTL_STRINGDATA**
while ( nLen > 0 ) while ( nLen > 0 )
{ {
/* Between A-Z (65-90), than to lowercase (+32) */ *pNewCharStr = rtl::toAsciiLowerCase( *pCharStr );
if ( (*pCharStr >= 65) && (*pCharStr <= 90) )
*pNewCharStr = *pCharStr+32;
else
*pNewCharStr = *pCharStr;
pNewCharStr++; pNewCharStr++;
pCharStr++; pCharStr++;
...@@ -1654,7 +1627,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiUpperCase )( IMPL_RTL_STRINGDATA** ...@@ -1654,7 +1627,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiUpperCase )( IMPL_RTL_STRINGDATA**
while ( nLen > 0 ) while ( nLen > 0 )
{ {
/* Between a-z (97-122), than to uppercase (-32) */ /* Between a-z (97-122), than to uppercase (-32) */
if ( (*pCharStr >= 97) && (*pCharStr <= 122) ) if ( rtl::isAsciiLowerCase(*pCharStr) )
{ {
/* Copy String */ /* Copy String */
IMPL_RTL_STRCODE* pNewCharStr = IMPL_RTL_STRINGNAME( ImplNewCopy )( ppThis, pStr, pCharStr-pStr->buffer ); 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** ...@@ -1670,11 +1643,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiUpperCase )( IMPL_RTL_STRINGDATA**
while ( nLen > 0 ) while ( nLen > 0 )
{ {
/* Between a-z (97-122), than to uppercase (-32) */ *pNewCharStr = rtl::toAsciiUpperCase( *pCharStr );
if ( (*pCharStr >= 97) && (*pCharStr <= 122) )
*pNewCharStr = *pCharStr-32;
else
*pNewCharStr = *pCharStr;
pNewCharStr++; pNewCharStr++;
pCharStr++; pCharStr++;
......
...@@ -850,7 +850,7 @@ bool INetContentTypes::parse(OUString const & rMediaType, ...@@ -850,7 +850,7 @@ bool INetContentTypes::parse(OUString const & rMediaType,
bool bDowncase = false; bool bDowncase = false;
while (p != pEnd && INetMIME::isTokenChar(*p)) while (p != pEnd && INetMIME::isTokenChar(*p))
{ {
bDowncase = bDowncase || INetMIME::isUpperCase(*p); bDowncase = bDowncase || rtl::isAsciiUpperCase(*p);
++p; ++p;
} }
if (p == pToken) if (p == pToken)
...@@ -868,7 +868,7 @@ bool INetContentTypes::parse(OUString const & rMediaType, ...@@ -868,7 +868,7 @@ bool INetContentTypes::parse(OUString const & rMediaType,
bDowncase = false; bDowncase = false;
while (p != pEnd && INetMIME::isTokenChar(*p)) while (p != pEnd && INetMIME::isTokenChar(*p))
{ {
bDowncase = bDowncase || INetMIME::isUpperCase(*p); bDowncase = bDowncase || rtl::isAsciiUpperCase(*p);
++p; ++p;
} }
if (p == pToken) if (p == pToken)
......
...@@ -360,7 +360,7 @@ bool checkWChar(CharClass const & rCharClass, OUString const & rStr, ...@@ -360,7 +360,7 @@ bool checkWChar(CharClass const & rCharClass, OUString const & rStr,
bool bPipe = false) bool bPipe = false)
{ {
sal_Unicode c = rStr[*pPos]; sal_Unicode c = rStr[*pPos];
if (INetMIME::isUSASCII(c)) if (rtl::isAscii(c))
{ {
static sal_uInt8 const aMap[128] static sal_uInt8 const aMap[128]
= { 0, 0, 0, 0, 0, 0, 0, 0, = { 0, 0, 0, 0, 0, 0, 0, 0,
...@@ -515,7 +515,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText, ...@@ -515,7 +515,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText,
sal_Unicode c = rText[nPos]; sal_Unicode c = rText[nPos];
if (bBoundary1) if (bBoundary1)
{ {
if (INetMIME::isAlpha(c)) if (rtl::isAsciiAlpha(c))
{ {
sal_Int32 i = nPos; sal_Int32 i = nPos;
INetProtocol eScheme = INetURLObject::CompareProtocolScheme(rText.copy(i, rEnd - i)); INetProtocol eScheme = INetURLObject::CompareProtocolScheme(rText.copy(i, rEnd - i));
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include <svx/sidebar/ValueSetWithTextControl.hxx> #include <svx/sidebar/ValueSetWithTextControl.hxx>
#include <tools/inetmime.hxx> #include <rtl/character.hxx>
#include <editeng/paperinf.hxx> #include <editeng/paperinf.hxx>
#include <sfx2/bindings.hxx> #include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx> #include <sfx2/dispatch.hxx>
...@@ -71,7 +71,7 @@ PageSizeControl::PageSizeControl( ...@@ -71,7 +71,7 @@ PageSizeControl::PageSizeControl(
for (short i = aText.getLength() - 1; i >= 0; i--) for (short i = aText.getLength() - 1; i >= 0; i--)
{ {
sal_Unicode c = aText[i]; sal_Unicode c = aText[i];
if ( INetMIME::isAlpha(c) || (c == '\'') || (c == '\"') || (c == '%') ) if ( rtl::isAsciiAlpha(c) || (c == '\'') || (c == '\"') || (c == '%') )
{ {
aMetricStr = OUString(c) + aMetricStr; aMetricStr = OUString(c) + aMetricStr;
} }
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "sal/types.h" #include "sal/types.h"
#include <rtl/character.hxx>
#include <algorithm> #include <algorithm>
#include <limits> #include <limits>
...@@ -562,7 +564,7 @@ static sal_uInt32 const aMustEncodeMap[128] ...@@ -562,7 +564,7 @@ static sal_uInt32 const aMustEncodeMap[128]
inline bool mustEncode(sal_uInt32 nUTF32, INetURLObject::Part ePart) 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 *& ...@@ -2209,7 +2211,7 @@ INetURLObject::PrefixInfo const * INetURLObject::getPrefix(sal_Unicode const *&
} }
if (p >= pEnd) if (p >= pEnd)
break; break;
sal_uInt32 nChar = INetMIME::toLowerCase(*p++); sal_uInt32 nChar = rtl::toAsciiLowerCase(*p++);
while (pFirst <= pLast && sal_uChar(pFirst->m_pPrefix[i]) < nChar) while (pFirst <= pLast && sal_uChar(pFirst->m_pPrefix[i]) < nChar)
++pFirst; ++pFirst;
while (pFirst <= pLast && sal_uChar(pLast->m_pPrefix[i]) > nChar) while (pFirst <= pLast && sal_uChar(pLast->m_pPrefix[i]) > nChar)
...@@ -2219,7 +2221,7 @@ INetURLObject::PrefixInfo const * INetURLObject::getPrefix(sal_Unicode const *& ...@@ -2219,7 +2221,7 @@ INetURLObject::PrefixInfo const * INetURLObject::getPrefix(sal_Unicode const *&
{ {
sal_Char const * q = pFirst->m_pPrefix + i; sal_Char const * q = pFirst->m_pPrefix + i;
while (p < pEnd && *q != '\0' while (p < pEnd && *q != '\0'
&& INetMIME::toLowerCase(*p) == sal_uChar(*q)) && rtl::toAsciiLowerCase(*p) == sal_uChar(*q))
{ {
++p; ++p;
++q; ++q;
...@@ -3229,7 +3231,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme, ...@@ -3229,7 +3231,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
eCharset, eEscapeType); eCharset, eEscapeType);
appendUCS4(aTheSynPath, appendUCS4(aTheSynPath,
eEscapeType == ESCAPE_NO ? eEscapeType == ESCAPE_NO ?
INetMIME::toLowerCase(nUTF32) : nUTF32, rtl::toAsciiLowerCase(nUTF32) : nUTF32,
eEscapeType, bOctets, PART_VIM, '=', eEscapeType, bOctets, PART_VIM, '=',
eCharset, false); eCharset, false);
} }
...@@ -3685,7 +3687,7 @@ OUString INetURLObject::decode(sal_Unicode const * pBegin, ...@@ -3685,7 +3687,7 @@ OUString INetURLObject::decode(sal_Unicode const * pBegin,
case ESCAPE_UTF32: case ESCAPE_UTF32:
if ( if (
INetMIME::isUSASCII(nUTF32) && rtl::isAscii(nUTF32) &&
( (
eMechanism == DECODE_TO_IURI || eMechanism == DECODE_TO_IURI ||
( (
...@@ -5062,7 +5064,7 @@ sal_uInt32 INetURLObject::getUTF32(sal_Unicode const *& rBegin, ...@@ -5062,7 +5064,7 @@ sal_uInt32 INetURLObject::getUTF32(sal_Unicode const *& rBegin,
OSL_FAIL( OSL_FAIL(
"INetURLObject::getUTF32(): Unsupported charset"); "INetURLObject::getUTF32(): Unsupported charset");
case RTL_TEXTENCODING_ASCII_US: case RTL_TEXTENCODING_ASCII_US:
rEscapeType = INetMIME::isUSASCII(nUTF32) ? rEscapeType = rtl::isAscii(nUTF32) ?
ESCAPE_UTF32 : ESCAPE_OCTET; ESCAPE_UTF32 : ESCAPE_OCTET;
break; break;
...@@ -5071,7 +5073,7 @@ sal_uInt32 INetURLObject::getUTF32(sal_Unicode const *& rBegin, ...@@ -5071,7 +5073,7 @@ sal_uInt32 INetURLObject::getUTF32(sal_Unicode const *& rBegin,
break; break;
case RTL_TEXTENCODING_UTF8: case RTL_TEXTENCODING_UTF8:
if (INetMIME::isUSASCII(nUTF32)) if (rtl::isAscii(nUTF32))
rEscapeType = ESCAPE_UTF32; rEscapeType = ESCAPE_UTF32;
else else
{ {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment