[PATCH] use LanguageTagIcu

Eike Rathke (via Code Review) gerrit at gerrit.libreoffice.org
Mon Apr 29 06:17:05 PDT 2013


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 at redhat.com>



More information about the LibreOffice mailing list