hwpfilter/source/hwpreader.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
New commits: commit e001a86393e363261617d2521b516287561905d4 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Fri Mar 4 19:55:14 2022 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sat Mar 5 06:22:06 2022 +0100 Use rtl::isAsciiDigit instead of custom macro Change-Id: Iabca31825dd47cee661b47b14f09e96459a42015 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131033 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index d6fdf29d1407..ff551174219f 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -37,6 +37,7 @@ #include <iostream> #include <locale.h> #include <sal/types.h> +#include <rtl/character.hxx> #include <rtl/ustrbuf.hxx> // xmloff/xmlkyd.hxx @@ -222,7 +223,6 @@ void HwpReader::makeTextDecls() } -#define ISNUMBER(x) ( (x) <= 0x39 && (x) >= 0x30 ) /** * make office:meta * Completed @@ -259,8 +259,8 @@ void HwpReader::makeMeta() unsigned short *pDate = hwpinfo.summary.date; int year,month,day,hour,minute; int gab = 0; - if( ISNUMBER( pDate[0] ) && ISNUMBER( pDate[1] ) && - ISNUMBER( pDate[2] ) && ISNUMBER( pDate[3] )) + if( rtl::isAsciiDigit( pDate[0] ) && rtl::isAsciiDigit( pDate[1] ) && + rtl::isAsciiDigit( pDate[2] ) && rtl::isAsciiDigit( pDate[3] )) { year = (pDate[0]-0x30) * 1000 + (pDate[1]-0x30) * 100 + (pDate[2]-0x30) * 10 + (pDate[3]-0x30); @@ -268,9 +268,9 @@ void HwpReader::makeMeta() else { year = 0; } - if( ISNUMBER( pDate[6] )) + if( rtl::isAsciiDigit( pDate[6] )) { - if( ISNUMBER( pDate[7] ) ) + if( rtl::isAsciiDigit( pDate[7] ) ) month = (pDate[6] - 0x30) * 10 + (pDate[6+ ++gab]-0x30); else month = (pDate[6] - 0x30); @@ -278,9 +278,9 @@ void HwpReader::makeMeta() else { month = 0; } - if( ISNUMBER( pDate[9 + gab] ) ) + if( rtl::isAsciiDigit( pDate[9 + gab] ) ) { - if( ISNUMBER( pDate[10 + gab])) { + if( rtl::isAsciiDigit( pDate[10 + gab])) { day = ( pDate[9 + gab] - 0x30 ) * 10 + (pDate[9+ gab + 1]-0x30); ++gab; } else @@ -289,9 +289,9 @@ void HwpReader::makeMeta() else { day = 0; } - if( ISNUMBER( pDate[17 + gab] ) ) + if( rtl::isAsciiDigit( pDate[17 + gab] ) ) { - if( ISNUMBER( pDate[18 + gab])) { + if( rtl::isAsciiDigit( pDate[18 + gab])) { hour = ( pDate[17 + gab] - 0x30 ) * 10 + (pDate[17+ gab + 1]-0x30); ++gab; } else @@ -300,9 +300,9 @@ void HwpReader::makeMeta() else { hour = 0; } - if( ISNUMBER( pDate[20 + gab] ) ) + if( rtl::isAsciiDigit( pDate[20 + gab] ) ) { - if( ISNUMBER( pDate[21 + gab])) { + if( rtl::isAsciiDigit( pDate[21 + gab])) { minute = ( pDate[20 + gab] - 0x30 ) * 10 + (pDate[20+ gab + 1]-0x30); ++gab; } else