Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3888

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/88/3888/1

Big ISDigit method and use isAsciiDigit from CharClass

Also remove the unused function strnccmp.

Change-Id: Ie857dfca1e52b1251f85abfba3cd0e12e509974f
---
M starmath/source/parse.cxx
1 file changed, 3 insertions(+), 17 deletions(-)



diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 04278e1..9ae5dff 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -50,12 +50,6 @@
 }
 }
 
-static inline bool strnccmp(const String &u1, xub_StrLen nIdx,
-                              const sal_Char *s2, xub_StrLen nLen)
-{
-    return u1.EqualsIgnoreCaseAscii( s2, nIdx, nLen );
-}
-
 static const sal_Unicode aDelimiterTable[] =
 {
     ' ',    '\t',   '\n',   '\r',   '+',    '-',    '*',    '/',    '=',    '#',
@@ -63,14 +57,6 @@
     ')',    '{',    '}',    '[',    ']',    '^',    '_',
     '\0'    // end of list symbol
 };
-
-
-static inline bool IsDigit( sal_Unicode cChar )
-{
-    return '0' <= cChar && cChar <= '9';
-}
-
-///////////////////////////////////////////////////////////////////////////
 
 SmToken::SmToken() :
     eType       (TUNKNOWN),
@@ -432,7 +418,7 @@
         // #i45779# parse numbers correctly
         // i.e. independent from the locale setting.
         // (note that #i11752# remains fixed)
-        if ((aRes.TokenType & KParseType::IDENTNAME) && IsDigit( cFirstChar ))
+        if ((aRes.TokenType & KParseType::IDENTNAME) && CharClass::isAsciiDigit( cFirstChar ))
         {
             ParseResult aTmpRes;
             LanguageTag aOldLoc( aCC.getLanguageTag() );
@@ -928,7 +914,7 @@
                         {
                             cChar = m_aBufferString.GetChar( ++m_nBufferIndex );
                         }
-                        while ( cChar == '.' || IsDigit( cChar ) );
+                        while ( cChar == '.' || CharClass::isAsciiDigit( cChar ) );
 
                         m_aCurToken.aText = m_aBufferString.Copy( sal::static_int_cast< xub_StrLen 
(nTxtStart),
                                                             sal::static_int_cast< xub_StrLen 
(m_nBufferIndex - nTxtStart) );
@@ -1915,7 +1901,7 @@
             else
                 bPoint = true;
         }
-        else if ( !IsDigit( cChar ) )
+        else if ( !CharClass::isAsciiDigit( cChar ) )
             return false;
     }
     return true;

-- 
To view, visit https://gerrit.libreoffice.org/3888
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie857dfca1e52b1251f85abfba3cd0e12e509974f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Marcos Souza <marcos.souza.org@gmail.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.