[Libreoffice-commits] .: 3 commits - i18npool/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Mar 10 12:53:16 PST 2011


 i18npool/source/breakiterator/breakiteratorImpl.cxx |   13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

New commits:
commit 35b9c4974a5cb7bf23d2e601766eb432bee681ec
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 10 20:20:39 2011 +0000

    USCRIPT_INVALID_CODE is -1 so take signed here

diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index 601d8f7..1dbc7d9 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -484,15 +484,14 @@ sal_Int16  BreakIteratorImpl::getScriptClass(sal_uInt32 currentChar)
 {
         static sal_uInt32 lastChar = 0;
         static sal_Int16 nRet = 0;
-        sal_uInt32 script;
 
         if (currentChar != lastChar) {
             lastChar = currentChar;
 
-            script = u_getIntPropertyValue(currentChar, UCHAR_SCRIPT);
+            int32_t script = u_getIntPropertyValue(currentChar, UCHAR_SCRIPT);
             if (script < 0)
                 nRet = ScriptType::WEAK;
-            else if (script >= SAL_N_ELEMENTS(scriptTypes))
+            else if (static_cast<size_t>(script) >= SAL_N_ELEMENTS(scriptTypes))
                 nRet = ScriptType::COMPLEX;         // anything new is going to be pretty wild
             else
                 nRet = scriptTypes[script];
commit 77017d048793b0a9f9628f962ae3f089c5361e86
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 10 20:13:31 2011 +0000

    use SAL_N_ELEMENTS

diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index 48b8866..601d8f7 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -480,8 +480,6 @@ static sal_Int16 scriptTypes[] = {
     ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN,
     ScriptType::WEAK};
 
-#define scriptTypesCount sizeof(scriptTypes) / sizeof(sal_Int16)
-
 sal_Int16  BreakIteratorImpl::getScriptClass(sal_uInt32 currentChar)
 {
         static sal_uInt32 lastChar = 0;
@@ -494,7 +492,7 @@ sal_Int16  BreakIteratorImpl::getScriptClass(sal_uInt32 currentChar)
             script = u_getIntPropertyValue(currentChar, UCHAR_SCRIPT);
             if (script < 0)
                 nRet = ScriptType::WEAK;
-            else if (script >= scriptTypesCount)
+            else if (script >= SAL_N_ELEMENTS(scriptTypes))
                 nRet = ScriptType::COMPLEX;         // anything new is going to be pretty wild
             else
                 nRet = scriptTypes[script];
commit a5c0be250002ee4ccde490ce855965e0071ab3f3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 10 20:12:27 2011 +0000

    unused UBlock2Script struct definition

diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index a9830a3..48b8866 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -443,12 +443,6 @@ sal_Int16 SAL_CALL BreakIteratorImpl::getWordType( const OUString& /*Text*/,
         return 0;
 }
 
-typedef struct {
-    UBlockCode from;
-    UBlockCode to;
-    sal_Int16 script;
-} UBlock2Script;
-
 static sal_Int16 scriptTypes[] = {
     ScriptType::WEAK, ScriptType::WEAK, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX,
     ScriptType::ASIAN, ScriptType::LATIN, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX,


More information about the Libreoffice-commits mailing list