diff options
author | Arnaud Versini <arnaud.versini@gmail.com> | 2016-10-08 20:47:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-09 05:41:25 +0000 |
commit | ed5ca17dce1d088ce3fbbb3a30f748ba92cd07d9 (patch) | |
tree | 13b2eeada8e483c7261441c8393f81ea98ec0ead /tools | |
parent | 445f157a132ba977fc026746221f8e85daa289cb (diff) |
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 <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/inet/inetmsg.cxx | 20 |
1 files changed, 5 insertions, 15 deletions
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 <tools/contnr.hxx> #include <rtl/instance.hxx> #include <comphelper/string.hxx> +#include <rtl/character.hxx> -#include <stdio.h> #include <map> -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; |