From ed5ca17dce1d088ce3fbbb3a30f748ba92cd07d9 Mon Sep 17 00:00:00 2001 From: Arnaud Versini Date: Sat, 8 Oct 2016 20:47:16 +0200 Subject: tools: use rtl/character.hxx in tools/source/inet/inetmsg.cxx Change-Id: I5e4b2abd5487a383af6a8e37a4c33a90d91ec2e4 Reviewed-on: https://gerrit.libreoffice.org/29610 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- tools/source/inet/inetmsg.cxx | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'tools/source') diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index b488ff99acc7..7208b5e57891 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -25,20 +25,10 @@ #include #include #include +#include -#include #include -inline bool ascii_isDigit( sal_Unicode ch ) -{ - return ((ch >= 0x0030) && (ch <= 0x0039)); -} - -inline bool ascii_isLetter( sal_Unicode ch ) -{ - return (( (ch >= 0x0041) && (ch <= 0x005A)) || ((ch >= 0x0061) && (ch <= 0x007A))); -} - void INetMIMEMessage::SetHeaderField_Impl ( const OString &rName, const OUString &rValue, @@ -72,7 +62,7 @@ static const sal_Char *months[12] = static sal_uInt16 ParseNumber(const OString& rStr, sal_uInt16& nIndex) { sal_uInt16 n = nIndex; - while ((n < rStr.getLength()) && ascii_isDigit(rStr[n])) n++; + while ((n < rStr.getLength()) && rtl::isAsciiDigit(rStr[n])) n++; OString aNum(rStr.copy(nIndex, (n - nIndex))); nIndex = n; @@ -83,7 +73,7 @@ static sal_uInt16 ParseNumber(const OString& rStr, sal_uInt16& nIndex) static sal_uInt16 ParseMonth(const OString& rStr, sal_uInt16& nIndex) { sal_uInt16 n = nIndex; - while ((n < rStr.getLength()) && ascii_isLetter(rStr[n])) n++; + while ((n < rStr.getLength()) && rtl::isAsciiAlpha(rStr[n])) n++; OString aMonth(rStr.copy(nIndex, 3)); nIndex = n; @@ -114,7 +104,7 @@ bool INetMIMEMessage::ParseDateField ( while ( (nIndex < aDateField.getLength()) && - (ascii_isLetter (aDateField[nIndex]) || + (rtl::isAsciiAlpha (aDateField[nIndex]) || (aDateField[nIndex] == ',') )) nIndex++; @@ -122,7 +112,7 @@ bool INetMIMEMessage::ParseDateField ( (aDateField[nIndex] == ' ')) nIndex++; - if (ascii_isLetter (aDateField[nIndex])) + if (rtl::isAsciiAlpha (aDateField[nIndex])) { // Format: ctime(). if ((aDateField.getLength() - nIndex) < 20) return false; -- cgit v1.2.3