[Libreoffice-commits] core.git: tools/source
Arnaud Versini
arnaud.versini at gmail.com
Sun Oct 9 05:43:58 UTC 2016
tools/source/inet/inetmsg.cxx | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
New commits:
commit ed5ca17dce1d088ce3fbbb3a30f748ba92cd07d9
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date: Sat Oct 8 20:47:16 2016 +0200
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 at collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx
index b488ff9..7208b5e 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;
More information about the Libreoffice-commits
mailing list