You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.8 KiB
37 lines
1.8 KiB
From 8180370d32d7a6af2b38ffb6bcfa614c1951434c Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
Date: Wed, 2 Jul 2014 12:35:11 +0100
|
|
Subject: [PATCH] allow build with icu 4.2
|
|
|
|
Change-Id: I4bbcff7963520426d4c04e15d2239431aff65b56
|
|
---
|
|
i18npool/source/collator/collator_unicode.cxx | 5 +++++
|
|
1 file changed, 5 insertions(+)
|
|
|
|
diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx
|
|
index 42dfef3..35c237d 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);
|
|
--
|
|
1.9.3
|
|
|