i18nlangtag/source/isolang/isolang.cxx | 19 ++++++++++--------- include/i18nlangtag/lang.h | 6 +++--- sc/source/filter/excel/xlstyle.cxx | 4 ++-- sw/source/filter/ww8/ww8scan.cxx | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-)
New commits: commit 4986ebf83a111c123b275a48fb6045bab7657730 Author: Eike Rathke <er...@redhat.com> Date: Fri Aug 30 02:04:24 2013 +0200 fixed CppunitTest_sw_rtfimport, {LANGUAGE_FRENCH,"fr",""} catcher needed Change-Id: Ic8152e16c86c2d8475542c131e0ac81697f3d557 diff --git a/i18nlangtag/source/isolang/isolang.cxx b/i18nlangtag/source/isolang/isolang.cxx index 5f449e4..e4ab25c 100644 --- a/i18nlangtag/source/isolang/isolang.cxx +++ b/i18nlangtag/source/isolang/isolang.cxx @@ -332,6 +332,7 @@ static IsoLanguageCountryEntry const aImplIsoLangEntries[] = { LANGUAGE_FRENCH_ZAIRE, "fr", "CD" }, // Democratic Republic Of Congo { LANGUAGE_FRENCH_MOROCCO, "fr", "MA" }, { LANGUAGE_FRENCH_REUNION, "fr", "RE" }, + { LANGUAGE_FRENCH, "fr", "" }, // needed as a catcher before other "fr" entries! { LANGUAGE_FRENCH_NORTH_AFRICA, "fr", "" }, { LANGUAGE_FRENCH_WEST_INDIES, "fr", "" }, // unknown ISO country code { LANGUAGE_FRISIAN_NETHERLANDS, "fy", "NL" }, commit 8d9dd7ba8a123b79661416d23fceb4c2f01c2165 Author: Eike Rathke <er...@redhat.com> Date: Fri Aug 30 01:47:45 2013 +0200 disentangled the LANGUAGE_CHINESE mess Change-Id: Idda0bcb5c70331e21214a10d85cad0c2d634473f diff --git a/i18nlangtag/source/isolang/isolang.cxx b/i18nlangtag/source/isolang/isolang.cxx index 6c39bde..5f449e4 100644 --- a/i18nlangtag/source/isolang/isolang.cxx +++ b/i18nlangtag/source/isolang/isolang.cxx @@ -104,9 +104,10 @@ struct IsoLangOtherEntry // locale of that language first. // // The default entry for a LangID <-> ISO mapping has to be first. For -// conversion of legacy mappings one LangID can map to multiple ISO codes, and -// one ISO code combination can map to multiple LangIDs. For compatibility with -// already existing calls it can also be a sequence as follows: +// conversion of legacy mappings one LangID can map to multiple ISO codes +// except if the LangID is primary-only, and one ISO code combination can map +// to multiple LangIDs. For compatibility with already existing calls it can +// also be a sequence as follows: // LANGUAGE_ENGLISH, "en", "" // LANGUAGE_ENGLISH_US, "en", "US" @@ -130,11 +131,9 @@ struct IsoLangOtherEntry // to match the language, see code. A call with "en-ZZ" (not in table) would // still result in LANGUAGE_ENGLISH. -/* erAck: 2007-07-05T20:01+0200 TODO: The entire suite's "primary language - * only" usage and locale fall back should be cleaned up and made consistent. I - * strongly doubt that most callers exactly expect the behavior described. - * Currently these primary LangIDs are used literally in OOo code: - * LANGUAGE_ENGLISH LANGUAGE_CHINESE +/* Currently (2013-08-29) only these primary LangID are still used literally in + * code: + * LANGUAGE_ENGLISH LANGUAGE_ARABIC_PRIMARY_ONLY */ static IsoLanguageCountryEntry const aImplIsoLangEntries[] = @@ -155,9 +154,10 @@ static IsoLanguageCountryEntry const aImplIsoLangEntries[] = { LANGUAGE_PORTUGUESE_BRAZILIAN, "pt", "BR" }, { LANGUAGE_DANISH, "da", "DK" }, { LANGUAGE_GREEK, "el", "GR" }, - { LANGUAGE_CHINESE, "zh", "" }, { LANGUAGE_CHINESE_SIMPLIFIED, "zh", "CN" }, + { LANGUAGE_CHINESE_SIMPLIFIED_LEGACY, "zh", "CN" }, { LANGUAGE_CHINESE_TRADITIONAL, "zh", "TW" }, + { LANGUAGE_CHINESE_TRADITIONAL_LEGACY, "zh", "TW" }, { LANGUAGE_CHINESE_HONGKONG, "zh", "HK" }, { LANGUAGE_CHINESE_SINGAPORE, "zh", "SG" }, { LANGUAGE_CHINESE_MACAU, "zh", "MO" }, diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h index f886557..3f80aaf 100644 --- a/include/i18nlangtag/lang.h +++ b/include/i18nlangtag/lang.h @@ -141,14 +141,14 @@ typedef unsigned short LanguageType; #define LANGUAGE_BURMESE 0x0455 #define LANGUAGE_CATALAN 0x0403 #define LANGUAGE_CHEROKEE_UNITED_STATES 0x045C -#define LANGUAGE_CHINESE 0x0004 /* primary only, not a locale! */ #define LANGUAGE_CHINESE_HONGKONG 0x0C04 #define LANGUAGE_CHINESE_MACAU 0x1404 #define LANGUAGE_CHINESE_SIMPLIFIED 0x0804 #define LANGUAGE_CHINESE_SINGAPORE 0x1004 #define LANGUAGE_CHINESE_TRADITIONAL 0x0404 -/* #define LANGUAGE_CHINESE_SIMPLIFIED 0x0004 */ /* artificial political? Defined as 'zh-CHS' by MS. Primary only! */ -/* #define LANGUAGE_CHINESE_TRADITIONAL 0x7C04 */ /* artificial political? Defined as 'zh-CHT' by MS. */ +#define LANGUAGE_CHINESE_SIMPLIFIED_LEGACY 0x0004 /* MS-.NET 'zh-CHS', primary only! but maps to 'zh-CN' */ +#define LANGUAGE_CHINESE_TRADITIONAL_LEGACY 0x7C04 /* MS-.NET 'zh-CHT' */ +#define LANGUAGE_CHINESE LANGUAGE_CHINESE_SIMPLIFIED /* most code uses LANGUAGE_CHINESE */ #define LANGUAGE_CORSICAN_FRANCE 0x0483 #define LANGUAGE_CROATIAN 0x041A #define LANGUAGE_CROATIAN_BOSNIA_HERZEGOVINA 0x101A diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx index ca4c4a3..5364c79 100644 --- a/sc/source/filter/excel/xlstyle.cxx +++ b/sc/source/filter/excel/xlstyle.cxx @@ -774,8 +774,8 @@ const NfIndexTableOffset PRV_NF_INDEX_REUSE = NF_INDEX_TABLE_ENTRIES; const LanguageType PRV_LANGUAGE_GERMAN_PRIM = LANGUAGE_GERMAN & LANGUAGE_MASK_PRIMARY; /** French primary language not defined, LANGUAGE_FRENCH belongs to France. */ const LanguageType PRV_LANGUAGE_FRENCH_PRIM = LANGUAGE_FRENCH & LANGUAGE_MASK_PRIMARY; -/** Parent language identifier for Asian languages (LANGUAGE_CHINESE is a primary only ID). */ -const LanguageType PRV_LANGUAGE_ASIAN_PRIM = LANGUAGE_CHINESE; +/** Parent language identifier for Asian languages. */ +const LanguageType PRV_LANGUAGE_ASIAN_PRIM = LANGUAGE_CHINESE & LANGUAGE_MASK_PRIMARY; // ---------------------------------------------------------------------------- diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index cde4e9c..55faade 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -7207,7 +7207,7 @@ sal_uInt16 WW8DopTypography::GetConvertedLang() const break; default: OSL_ENSURE(!this, "Unknown MS Asian Typography language, report"); - nLang = LANGUAGE_CHINESE; + nLang = LANGUAGE_CHINESE_SIMPLIFIED_LEGACY; break; case 0: //And here we have the possibility that it says 2, but its really _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits