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/4139

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/39/4139/1

Fix icu version checks.

commit 30c303 "Make charmap.cxx compile with icu >= 4.4." was incomplete
and had wrong version checks. After ICU 4.8 (4.8.1.1) the next version
of ICU was 49 (49.1) so U_ICU_VERSION_MAJOR_NUM contains two digets (49),
earlier that it was just one digit (4). The correct header to include to
do version checks is unicode/uversion.h. USCRIPT_MANDAEAN is the old
alias of USCRIPT_MANDAIC (same numeric value). U_JG_FARSI_YEH is only
available since ICU 4.4. Note that on older icu versions (4.2.1) the
200B (ZWSP) Zero Width Space breakiterator testcase fails (others
succeed).

Change-Id: If73c1402239a28546077437e9382f0bd38642bad
---
M i18npool/qa/cppunit/test_breakiterator.cxx
M i18nutil/source/utility/unicode.cxx
M svx/source/dialog/charmap.cxx
M sw/source/core/text/porlay.cxx
4 files changed, 13 insertions(+), 6 deletions(-)



diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx
index b3ec68f..4ba6a79 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -19,7 +19,7 @@
 #include <com/sun/star/i18n/WordType.hpp>
 #include <unotest/bootstrapfixturebase.hxx>
 
-#include <unicode/uvernum.h>
+#include <unicode/uversion.h>
 
 #include <rtl/strbuf.hxx>
 #include <rtl/ustrbuf.hxx>
@@ -236,6 +236,8 @@
     }
 
     //See https://bugs.freedesktop.org/show_bug.cgi?id=49629
+    //Note that the breakiterator test will fail on older icu versions
+    //(4.2.1) for the 200B (ZWSP) Zero Width Space testcase.
     sal_Unicode aBreakTests[] = { ' ', 1, 2, 3, 4, 5, 6, 7, 0x91, 0x92, 0x200B, 0xE8FF, 0xF8FF };
     for (int mode = i18n::WordType::ANY_WORD; mode <= i18n::WordType::WORD_COUNT; ++mode)
     {
diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx
index 2c2dd42..b46a7f6 100644
--- a/i18nutil/source/utility/unicode.cxx
+++ b/i18nutil/source/utility/unicode.cxx
@@ -826,15 +826,15 @@
         case USCRIPT_TAI_VIET:
             sRet = "blt";
             break;
+        case USCRIPT_MANDAEAN: /* Aliased to USCRIPT_MANDAIC in icu 4.6. */
+            sRet = "mic";
+            break;
 #if (U_ICU_VERSION_MAJOR_NUM > 4) || (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM >= 4)
         case USCRIPT_NABATAEAN: //no language with an assigned code yet
             sRet = "mis";
             break;
         case USCRIPT_PALMYRENE: //no language with an assigned code yet
             sRet = "mis";
-            break;
-        case USCRIPT_MANDAIC:
-            sRet = "mic";
             break;
         case USCRIPT_BAMUM:
             sRet = "bax";
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index bc6c83e..907d9f8 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -1302,7 +1302,7 @@
                 case UBLOCK_DOMINO_TILES:
                     aAllSubsets.push_back( Subset( 0x1F030, 0x1F09F, RID_SUBSETSTR_DOMINO_TILES ) 
);
                     break;
-#if U_ICU_VERSION_MAJOR_NUM >= 44
+#if (U_ICU_VERSION_MAJOR_NUM > 4) || (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM >= 4)
                 case UBLOCK_SAMARITAN:
                     aAllSubsets.push_back( Subset( 0x0800, 0x083F, RID_SUBSETSTR_SAMARITAN ) );
                     break;
@@ -1382,7 +1382,7 @@
                     aAllSubsets.push_back( Subset( 0x2A700, 0x2B73F, 
RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C ) );
                     break;
 #endif
-#if U_ICU_VERSION_MAJOR_NUM >= 46
+#if (U_ICU_VERSION_MAJOR_NUM > 4) || (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM >= 6)
                 case UBLOCK_MANDAIC:
                     aAllSubsets.push_back( Subset( 0x0840, 0x085F, RID_SUBSETSTR_MANDAIC ) );
                     break;
@@ -1420,6 +1420,7 @@
                     aAllSubsets.push_back( Subset( 0x2B740, 0x2B81F, 
RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D ) );
                     break;
 #endif
+// Note ICU version 49 (NOT 4.9), so the MAJOR_NUM is two digits.
 #if U_ICU_VERSION_MAJOR_NUM >= 49
                 case UBLOCK_ARABIC_EXTENDED_A:
                     aAllSubsets.push_back( Subset( 0x08A0, 0x08FF, RID_SUBSETSTR_ARABIC_EXTENDED_A 
) );
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index b820b8b..edc8458 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -72,7 +72,11 @@
 #define isRehChar(c)        IS_JOINING_GROUP((c), REH)
 #define isTehMarbutaChar(c) IS_JOINING_GROUP((c), TEH_MARBUTA)
 #define isWawChar(c)        IS_JOINING_GROUP((c), WAW)
+#if (U_ICU_VERSION_MAJOR_NUM > 4) || (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM >= 4)
 #define isYehChar(c)        (IS_JOINING_GROUP((c), YEH) || IS_JOINING_GROUP((c), FARSI_YEH))
+#else
+#define isYehChar(c)        IS_JOINING_GROUP((c), YEH)
+#endif
 #define isSeenOrSadChar(c)  (IS_JOINING_GROUP((c), SAD) || IS_JOINING_GROUP((c), SEEN))
 
 bool isTransparentChar ( sal_Unicode cCh )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If73c1402239a28546077437e9382f0bd38642bad
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Mark Wielaard <mark@klomp.org>


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.