Kaydet (Commit) 5b01acf7 authored tarafından Marcos Paulo de Souza's avatar Marcos Paulo de Souza Kaydeden (comit) Eike Rathke

Bin IsDigit method and use isAsciiDigit from CharClass

Also remove the unused function strnccmp.

Change-Id: Ie857dfca1e52b1251f85abfba3cd0e12e509974f
Reviewed-on: https://gerrit.libreoffice.org/3888Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst 42824b9c
...@@ -50,12 +50,6 @@ T* lcl_popOrZero( ::std::stack<T*> & rStack ) ...@@ -50,12 +50,6 @@ T* lcl_popOrZero( ::std::stack<T*> & rStack )
} }
} }
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[] = static const sal_Unicode aDelimiterTable[] =
{ {
' ', '\t', '\n', '\r', '+', '-', '*', '/', '=', '#', ' ', '\t', '\n', '\r', '+', '-', '*', '/', '=', '#',
...@@ -64,14 +58,6 @@ static const sal_Unicode aDelimiterTable[] = ...@@ -64,14 +58,6 @@ static const sal_Unicode aDelimiterTable[] =
'\0' // end of list symbol '\0' // end of list symbol
}; };
static inline bool IsDigit( sal_Unicode cChar )
{
return '0' <= cChar && cChar <= '9';
}
///////////////////////////////////////////////////////////////////////////
SmToken::SmToken() : SmToken::SmToken() :
eType (TUNKNOWN), eType (TUNKNOWN),
cMathChar ('\0') cMathChar ('\0')
...@@ -432,7 +418,7 @@ void SmParser::NextToken() ...@@ -432,7 +418,7 @@ void SmParser::NextToken()
// #i45779# parse numbers correctly // #i45779# parse numbers correctly
// i.e. independent from the locale setting. // i.e. independent from the locale setting.
// (note that #i11752# remains fixed) // (note that #i11752# remains fixed)
if ((aRes.TokenType & KParseType::IDENTNAME) && IsDigit( cFirstChar )) if ((aRes.TokenType & KParseType::IDENTNAME) && CharClass::isAsciiDigit( cFirstChar ))
{ {
ParseResult aTmpRes; ParseResult aTmpRes;
LanguageTag aOldLoc( aCC.getLanguageTag() ); LanguageTag aOldLoc( aCC.getLanguageTag() );
...@@ -928,7 +914,7 @@ void SmParser::NextToken() ...@@ -928,7 +914,7 @@ void SmParser::NextToken()
{ {
cChar = m_aBufferString.GetChar( ++m_nBufferIndex ); 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), m_aCurToken.aText = m_aBufferString.Copy( sal::static_int_cast< xub_StrLen >(nTxtStart),
sal::static_int_cast< xub_StrLen >(m_nBufferIndex - nTxtStart) ); sal::static_int_cast< xub_StrLen >(m_nBufferIndex - nTxtStart) );
...@@ -1915,7 +1901,7 @@ static bool lcl_IsNumber(const OUString& rText) ...@@ -1915,7 +1901,7 @@ static bool lcl_IsNumber(const OUString& rText)
else else
bPoint = true; bPoint = true;
} }
else if ( !IsDigit( cChar ) ) else if ( !CharClass::isAsciiDigit( cChar ) )
return false; return false;
} }
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment