Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3669
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/69/3669/1
use LanguageTagIcu
Change-Id: I7b052a3f73740ff3a35f38dc2d96bc621b8d8deb
---
M i18npool/source/collator/collator_unicode.cxx
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/i18npool/source/collator/collator_unicode.cxx
b/i18npool/source/collator/collator_unicode.cxx
index 40b5c47..a7cf05b 100644
--- a/i18npool/source/collator/collator_unicode.cxx
+++ b/i18npool/source/collator/collator_unicode.cxx
@@ -22,6 +22,8 @@
#include "lrl_include.hxx"
#include <rtl/ustrbuf.hxx>
+#include <i18nlangtag/languagetag.hxx>
+#include <i18nlangtag/languagetagicu.hxx>
#include <collator_unicode.hxx>
#include <localedata.hxx>
#include <com/sun/star/i18n/CollatorOptions.hpp>
@@ -213,13 +215,10 @@
/** ICU collators are loaded using a locale only.
ICU uses Variant as collation algorithm name (like de__PHONEBOOK
locale), note the empty territory (Country) designator in this special
- case here. The icu::Locale contructor changes the algorithm name to
+ case here. The icu::Locale constructor changes the algorithm name to
uppercase itself, so we don't have to bother with that.
*/
- icu::Locale icuLocale(
- OUStringToOString(rLocale.Language, RTL_TEXTENCODING_ASCII_US).getStr(),
- OUStringToOString(rLocale.Country, RTL_TEXTENCODING_ASCII_US).getStr(),
- OUStringToOString(rAlgorithm, RTL_TEXTENCODING_ASCII_US).getStr());
+ icu::Locale icuLocale( LanguageTagIcu::getIcuLocale( LanguageTag( rLocale),
rAlgorithm));
// load ICU collator
collator = (RuleBasedCollator*) icu::Collator::createInstance(icuLocale, status);
if (! U_SUCCESS(status)) throw RuntimeException();
--
To view, visit https://gerrit.libreoffice.org/3669
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b052a3f73740ff3a35f38dc2d96bc621b8d8deb
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Eike Rathke <erack@redhat.com>
Context
- [PATCH] use LanguageTagIcu · Eike Rathke (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.