diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-07-02 12:35:11 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-07-04 11:33:54 +0200 |
commit | 28d8ceba68e739303b40a1218af3bcea08b18196 (patch) | |
tree | 4bca977be1886fc665a458e42e965a0b6cfe481a /i18npool | |
parent | 4f369500d316126d4d7a9a1856e9ea481e735254 (diff) |
allow build with icu 4.2
Change-Id: I4bbcff7963520426d4c04e15d2239431aff65b56
Reviewed-on: https://gerrit.libreoffice.org/10042
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/collator/collator_unicode.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx index 42dfef382c24..35c237d4cd82 100644 --- a/i18npool/source/collator/collator_unicode.cxx +++ b/i18npool/source/collator/collator_unicode.cxx @@ -308,6 +308,10 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang:: if (func && funclen) { const sal_uInt8* ruleImage=func(); size_t ruleImageSize = funclen(); + +#if (U_ICU_VERSION_MAJOR_NUM == 4) && (U_ICU_VERSION_MINOR_NUM <= 2) + uca_base = new RuleBasedCollator(static_cast<UChar*>(NULL), status); +#else // Not only changed ICU 53.1 the API behavior that a negative // length (ruleImageSize) now leads to failure, but also that // the base RuleBasedCollator passed as uca_base here needs to @@ -319,6 +323,7 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang:: // NULL (default) locale does not. uca_base = static_cast<RuleBasedCollator*>(icu::Collator::createInstance( icu::Locale::getRoot(), status)); +#endif if (! U_SUCCESS(status)) throw RuntimeException(); collator = new RuleBasedCollator( reinterpret_cast<const uint8_t*>(ruleImage), ruleImageSize, uca_base, status); |