summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-07-02 12:35:11 +0100
committerEike Rathke <erack@redhat.com>2014-07-03 08:38:08 +0000
commit9153b804cd2a1149a6811db74fa9be594b275391 (patch)
tree39335760e52ffdc3802be7c8cc8b8e38bfeb1da9 /i18npool
parentc4eb0e2e0a2c14d53cad999a3c0f1c1048914a4f (diff)
allow build with icu 4.2
Change-Id: I4bbcff7963520426d4c04e15d2239431aff65b56 (cherry picked from commit 414540aecae90774e12390cfcf8f0a37e10684b4) Reviewed-on: https://gerrit.libreoffice.org/10044 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.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx
index 2960f031c5e4..d0aef3f5a21f 100644
--- a/i18npool/source/collator/collator_unicode.cxx
+++ b/i18npool/source/collator/collator_unicode.cxx
@@ -333,6 +333,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
@@ -344,6 +348,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);