[Libreoffice-commits] core.git: basic/source

Arnaud Versini arnaud.versini at gmail.com
Tue Aug 9 06:27:23 UTC 2016


 basic/source/sbx/sbxscan.cxx |   15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

New commits:
commit a22328eea392aeeb0d0cbe7492ce185a36777da1
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date:   Sun Aug 7 21:47:59 2016 +0200

    BASIC: Use rtl/character.hxx in basic/source/sbx/sbxscan.cxx
    
    Change-Id: I018bc2881bca1973ef5e5133f3954252d5cea65e
    Reviewed-on: https://gerrit.libreoffice.org/27993
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index cc864ec..de98ad1 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -45,6 +45,7 @@
 #include "runtime.hxx"
 
 #include <rtl/strbuf.hxx>
+#include <rtl/character.hxx>
 #include <svl/zforlist.hxx>
 #include <comphelper/processfactory.hxx>
 
@@ -57,10 +58,6 @@ void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep )
     rcThousandSep = rData.getNumThousandSep()[0];
 }
 
-inline bool ImpIsDigit( sal_Unicode c )
-{
-    return '0' <= c && c <= '9';
-}
 
 /** NOTE: slightly differs from strchr() in that it does not consider the
     terminating NULL character to be part of the string and returns bool
@@ -78,10 +75,6 @@ bool ImpStrChr( const sal_Unicode* p, sal_Unicode c )
     return false;
 }
 
-bool ImpIsAlNum( sal_Unicode c )
-{
-    return c < 128 && isalnum( static_cast<char>(c) );
-}
 
 // scanning a string according to BASIC-conventions
 // but exponent may also be a D, so data type is SbxDOUBLE
@@ -118,8 +111,8 @@ SbxError ImpScan( const OUString& rWSrc, double& nVal, SbxDataType& rType,
         p++;
         bMinus = true;
     }
-    if( ImpIsDigit( *p ) || ((*p == cNonIntntlDecSep || *p == cIntntlDecSep ||
-                    (cIntntlDecSep && *p == cIntntlGrpSep)) && ImpIsDigit( *(p+1) )))
+    if( rtl::isAsciiDigit( *p ) || ((*p == cNonIntntlDecSep || *p == cIntntlDecSep ||
+                    (cIntntlDecSep && *p == cIntntlGrpSep)) && rtl::isAsciiDigit( *(p+1) )))
     {
         short exp = 0;
         short decsep = 0;
@@ -229,7 +222,7 @@ SbxError ImpScan( const OUString& rWSrc, double& nVal, SbxDataType& rType,
                 bRes = false;
         }
         const sal_Unicode* const pCmp = aCmp.getStr();
-        while( ImpIsAlNum( *p ) )    /* XXX: really munge all alnum also when error? */
+        while( rtl::isAsciiAlphanumeric( *p ) )    /* XXX: really munge all alnum also when error? */
         {
             sal_Unicode ch = *p;
             if( ImpStrChr( pCmp, ch ) )


More information about the Libreoffice-commits mailing list