summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-04-24 18:26:59 +0300
committerTor Lillqvist <tml@collabora.com>2014-04-24 19:44:10 +0300
commit25d88d2b8eebb4782a016e03aa8562ad9fa15b7b (patch)
tree30b5cafa05573f31b9d044e314c170610310667d /i18npool
parent95711f5b9e7b6a982d1762d37d5a38e0f40b86f9 (diff)
More hacking on --with-locales
Propagate the restriction of locales into <config_locales.h>. Note that in the normal case, with no locale restrictions, all the WITH_LOCALE_xx macros are zero anyway, but WITH_LOCALE_ALL is one. Restrict which character encodings are handled in sal/textencsal/textenc/tables.cxx based on the WITH_LOCALE_ macros. (Don't simply always do it for iOS.) Massage the affected unit tests to not crash when only partial character encoding information is present. Change-Id: Ie2c882c262ebd0d2b37dde66b8fe3c3e2570da14
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/CustomTarget_collator.mk10
-rw-r--r--i18npool/source/collator/collator_unicode.cxx24
2 files changed, 12 insertions, 22 deletions
diff --git a/i18npool/CustomTarget_collator.mk b/i18npool/CustomTarget_collator.mk
index 9fea159df2fc..f9bb82077f13 100644
--- a/i18npool/CustomTarget_collator.mk
+++ b/i18npool/CustomTarget_collator.mk
@@ -55,20 +55,10 @@ $(i18npool_CODIR)/collator_%.cxx : \
$(call gb_Helper_abbreviate_dirs, \
$(call gb_Helper_execute,gencoll_rule) $< $@ $*)
-define i18npool_echo_one_lang
- echo '#define LOCAL_RULE_$(1)' >>$@
-
-endef
-
$(i18npool_CODIR)/lrl_include.hxx : \
$(SRCDIR)/i18npool/source/collator/data | $(i18npool_CODIR)/.dir
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
echo '#define LOCAL_RULE_LANGS "$(sort $(foreach txt,$(i18npool_COTXTS), \
$(firstword $(subst _, ,$(txt)))))"' > $@
-ifeq ($(WITH_LOCALES),)
- echo '#define LOCAL_RULE_ALL' >>$@
-else
- $(foreach txt,$(i18npool_COTXTS),$(call i18npool_echo_one_lang,$(subst .txt,,$(txt))))
-endif
# vim: set noet sw=4 ts=4:
diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx
index 5f03e4b9dd3f..ae7b41bbe9d3 100644
--- a/i18npool/source/collator/collator_unicode.cxx
+++ b/i18npool/source/collator/collator_unicode.cxx
@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_locales.h>
-// generated list of languages
#include "lrl_include.hxx"
#include <rtl/ustrbuf.hxx>
@@ -156,23 +156,23 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
#else
if (false) {
;
-#if defined LOCAL_RULE_ALL || defined LOCAL_RULE_ca_charset
+#if WITH_LOCALE_ALL || WITH_LOCALE_CA
} else if ( rLocale.Language == "ca" ) {
if ( rAlgorithm == "charset" )
func = get_collator_data_ca_charset;
#endif
-#if defined LOCAL_RULE_ALL || defined LOCAL_RULE_dz_charset
+#if WITH_LOCALE_ALL || WITH_LOCALE_DZ
} else if ( rLocale.Language == "dz" || rLocale.Language == "bo" ) {
// 'bo' Tibetan uses the same collation rules as 'dz' Dzongkha
if ( rAlgorithm == "charset" )
func = get_collator_data_dz_charset;
#endif
-#if defined LOCAL_RULE_ALL || defined LOCAL_RULE_hu
+#if WITH_LOCALE_ALL || WITH_LOCALE_HU
} else if ( rLocale.Language == "hu" ) {
if ( rAlgorithm == "charset" )
func = get_collator_data_hu_charset;
#endif
-#if defined LOCAL_RULE_ALL || defined LOCAL_RULE_ja_charset
+#if WITH_LOCALE_ALL || WITH_LOCALE_JA
} else if ( rLocale.Language == "ja" ) {
if ( rAlgorithm == "charset" )
func = get_collator_data_ja_charset;
@@ -181,37 +181,37 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
else if ( rAlgorithm == "phonetic (alphanumeric last)" )
func = get_collator_data_ja_phonetic_alphanumeric_last;
#endif
-#if defined LOCAL_RULE_ALL || defined LOCAL_RULE_ko_charset
+#if WITH_LOCALE_ALL || WITH_LOCALE_KO
} else if ( rLocale.Language == "ko" ) {
if ( rAlgorithm == "charset" )
func = get_collator_data_ko_charset;
#endif
-#if defined LOCAL_RULE_ALL || defined LOCAL_RULE_ku_charset
+#if WITH_LOCALE_ALL || WITH_LOCALE_KU
} else if ( rLocale.Language == "ku" ) {
if ( rAlgorithm == "alphanumeric" )
func = get_collator_data_ku_alphanumeric;
#endif
-#if defined LOCAL_RULE_ALL || defined LOCAL_RULE_ln_charset
+#if WITH_LOCALE_ALL || WITH_LOCALE_LN
} else if ( rLocale.Language == "ln" ) {
if ( rAlgorithm == "charset" )
func = get_collator_data_ln_charset;
#endif
-#if defined LOCAL_RULE_ALL || defined LOCAL_RULE_my_charset
+#if WITH_LOCALE_ALL || WITH_LOCALE_MY
} else if ( rLocale.Language == "my" ) {
if ( rAlgorithm == "dictionary" )
func = get_collator_data_my_dictionary;
#endif
-#if defined LOCAL_RULE_ALL || defined LOCAL_RULE_ne_charset
+#if WITH_LOCALE_ALL || WITH_LOCALE_NE
} else if ( rLocale.Language == "ne" ) {
if ( rAlgorithm == "charset" )
func = get_collator_data_ne_charset;
#endif
-#if defined LOCAL_RULE_ALL || defined LOCAL_RULE_sid_charset
+#if WITH_LOCALE_ALL || WITH_LOCALE_SID
} else if ( rLocale.Language == "sid" ) {
if ( rAlgorithm == "charset" )
func = get_collator_data_sid_charset;
#endif
-#if defined LOCAL_RULE_ALL || defined LOCAL_RULE_zh_charset
+#if WITH_LOCALE_ALL || WITH_LOCALE_ZH
} else if ( rLocale.Language == "zh" && (rLocale.Country == "TW" || rLocale.Country == "HK" || rLocale.Country == "MO") ) {
if ( rAlgorithm == "charset" )
func = get_collator_data_zh_TW_charset;