* In locale data replaceTo must not be empty if replaceFrom isn't.
+ Also added check to locale data compiler to prevent this in future.
* Fixed a currency format's group separator.
* Marked LANGUAGE_USER_KABYLE (0x0659) obsolete as LANGUAGE_TAMAZIGHT_LATIN
  (0x085F) is used instead, actually commit
  909c9aa4550a068513300bc3e899c0466d9287b4 crossed
  b51eaf4c5083ec35366d18c522a7dd50f9c9b3c0
- Removed the corresponding duplicated entry from langtab.src

Stumbled upon this when in an --enable-dbgutil build initializing the number
formats when opening a new spreadsheet gave

LocaleDataWrapper::getCurrFormatsImpl: CurrPositiveFormat?
kab_DZ requested
kab_DZ loaded

LocaleDataWrapper::getCurrFormatsImpl: CurrNegativeFormat?
kab_DZ requested
kab_DZ loaded

and choosing Kabyle Latin in the number formatter dialog gave a few

SvNumberFormatter::ImpInsertFormat: no [$...] on currency format code, index 12:
#.##0;-#.##0
kab_DZ requested
kab_DZ loaded

and so on.

The result were generated formats in the form
#.##0,00[$DA-85F];[RED]-#.##0,00[$DA-85F]
instead of
[$DA-85F]#.##0,00;[RED]-[$DA-85F]#,##0,00
---
 i18npool/inc/i18npool/lang.h               |    3 ++-
 i18npool/source/isolang/isolang.cxx        |    2 +-
 i18npool/source/isolang/mslangid.cxx       |    3 +++
 i18npool/source/localedata/LocaleNode.cxx  |    5 ++++-
 i18npool/source/localedata/data/kab_DZ.xml |    4 ++--
 svtools/source/misc/langtab.src            |    1 -
 6 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/i18npool/inc/i18npool/lang.h b/i18npool/inc/i18npool/lang.h
index ab195d6..e34b019 100644
--- a/i18npool/inc/i18npool/lang.h
+++ b/i18npool/inc/i18npool/lang.h
@@ -520,7 +520,8 @@ typedef unsigned short LanguageType;
 #define LANGUAGE_USER_YIDDISH_US            0x083D  /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_YIDDISH)) */
 #define LANGUAGE_USER_LIMBU                 0x0657
 #define LANGUAGE_USER_LOJBAN                0x0658  /* no locale */
-#define LANGUAGE_USER_KABYLE                0x0659
+#define LANGUAGE_OBSOLETE_USER_KABYLE       0x0659
+#define LANGUAGE_USER_KABYLE                LANGUAGE_TAMAZIGHT_LATIN
 #define LANGUAGE_USER_HAITIAN               0x065A
 #define LANGUAGE_USER_BEEMBE                0x065B
 #define LANGUAGE_USER_BEKWEL                0x065C
diff --git a/i18npool/source/isolang/isolang.cxx b/i18npool/source/isolang/isolang.cxx
index 3dac780..c777c74 100644
--- a/i18npool/source/isolang/isolang.cxx
+++ b/i18npool/source/isolang/isolang.cxx
@@ -386,6 +386,7 @@ static MsLangId::IsoLangEntry const aImplIsoLangEntries[] =
 //  { LANGUAGE_IBIBIO_NIGERIA,             "nic", "NG" },   // ISO "nic" is only a collective language code
     { LANGUAGE_YI,                          "ii", "CN" },
     { LANGUAGE_TAMAZIGHT_LATIN,            "kab", "DZ" },   // In practice Kabyle is the language used for this
+    { LANGUAGE_OBSOLETE_USER_KABYLE,       "kab", "DZ" },
     { LANGUAGE_TAMAZIGHT_LATIN,            "ber", "DZ" },   // In practice Algeria has standardized on Kabyle as the member of the "ber" collective which gets used there.
     { LANGUAGE_TAMAZIGHT_TIFINAGH,         "ber", "MA" },   // Morocco is officially using Tifinagh for its Berber languages so store it to distinguish explicitly from LANGUAGE_TAMAZIGHT_LATIN, even though as a collective language its not of much use
 //  { LANGUAGE_TAMAZIGHT_ARABIC,           "ber", ""   },   // ISO "ber" only collective!
@@ -467,7 +468,6 @@ static MsLangId::IsoLangEntry const aImplIsoLangEntries[] =
     { LANGUAGE_USER_RUSYN_SLOVAKIA,        "rue", "SK" },
     { LANGUAGE_USER_LIMBU,                 "lif", "NP" },
     { LANGUAGE_USER_LOJBAN,                "jbo", ""   },
-    { LANGUAGE_USER_KABYLE,                "kab", "DZ" },
     { LANGUAGE_USER_HAITIAN,                "ht", "HT" },
     { LANGUAGE_FRENCH_HAITI,                "fr", "HT" },
     { LANGUAGE_USER_BEEMBE,                "beq", "CG" },
diff --git a/i18npool/source/isolang/mslangid.cxx b/i18npool/source/isolang/mslangid.cxx
index 74838ba..ec4f99c 100644
--- a/i18npool/source/isolang/mslangid.cxx
+++ b/i18npool/source/isolang/mslangid.cxx
@@ -414,6 +414,9 @@ LanguageType MsLangId::getReplacementForObsoleteLanguage( LanguageType nLang )
         case LANGUAGE_OBSOLETE_USER_LUXEMBOURGISH:
             nLang = LANGUAGE_LUXEMBOURGISH_LUXEMBOURG;
             break;
+        case LANGUAGE_OBSOLETE_USER_KABYLE:
+            nLang = LANGUAGE_TAMAZIGHT_LATIN;
+            break;
 
         // The following are not strictly obsolete but should be mapped to a 
         // replacement locale when encountered.
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 72f4464..5cae6a0 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -598,8 +598,11 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
     OUString str;
     if (mnSection >= 2)
         incError("more than 2 LC_FORMAT sections");
-    of.writeParameter("replaceFrom", getAttr().getValueByName("replaceFrom"), mnSection);
+    OUString strFrom( getAttr().getValueByName("replaceFrom"));
+    of.writeParameter("replaceFrom", strFrom, mnSection);
     str = getAttr().getValueByName("replaceTo");
+    if (strFrom.getLength() && !str.getLength())
+        incErrorStr("replaceFrom=\"%s\" replaceTo=\"\" is empty replacement.", strFrom);
     // Locale data generator inserts FFFF for LangID, we need to adapt that.
     if (str.endsWithIgnoreAsciiCaseAsciiL( "-FFFF]", 6))
         incErrorStr("replaceTo=\"%s\" needs FFFF to be adapted to the real LangID value.", str);
diff --git a/i18npool/source/localedata/data/kab_DZ.xml b/i18npool/source/localedata/data/kab_DZ.xml
index 41e3ab2..0e3ac54 100644
--- a/i18npool/source/localedata/data/kab_DZ.xml
+++ b/i18npool/source/localedata/data/kab_DZ.xml
@@ -34,7 +34,7 @@
 <TimePM>n tmeddit</TimePM>
 <MeasurementSystem>metric</MeasurementSystem>
 </LC_CTYPE>
-<LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="">
+<LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$DA-85F]">
 <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
 <FormatCode>General</FormatCode>
 </FormatElement>
@@ -69,7 +69,7 @@
 <FormatCode>[CURRENCY]#.##0;-[CURRENCY]#.##0</FormatCode>
 </FormatElement>
 <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13">
-<FormatCode>[CURRENCY]#.##0,00;-[CURRENCY]#,##0,00</FormatCode>
+<FormatCode>[CURRENCY]#.##0,00;-[CURRENCY]#.##0,00</FormatCode>
 </FormatElement>
 <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14">
 <FormatCode>[CURRENCY]#.##0;[RED]-[CURRENCY]#.##0</FormatCode>
diff --git a/svtools/source/misc/langtab.src b/svtools/source/misc/langtab.src
index 81d4f96..4a625bc 100644
--- a/svtools/source/misc/langtab.src
+++ b/svtools/source/misc/langtab.src
@@ -329,7 +329,6 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE
         < "Hawaiian" ; LANGUAGE_HAWAIIAN_UNITED_STATES ; > ;
         < "Limbu" ; LANGUAGE_USER_LIMBU ; > ;
         < "Lojban" ; LANGUAGE_USER_LOJBAN ; > ;
-        < "Kabyle" ; LANGUAGE_USER_KABYLE ; > ;
         < "Haitian" ; LANGUAGE_USER_HAITIAN ; > ;
         < "Beembe" ; LANGUAGE_USER_BEEMBE ; > ;
         < "Bekwel" ; LANGUAGE_USER_BEKWEL ; > ;
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to