summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-04-24 23:48:44 +0200
committerEike Rathke <erack@redhat.com>2013-04-25 00:01:07 +0200
commit0cb65cee8a700afdcde945e5a8291b6498042bb9 (patch)
tree0d90365f2cd1c1be97b34ec57bfbc74cefc47b61 /i18npool
parent4806df614a0e7e499aef3d10f77923f189207205 (diff)
use LanguageTagIcu
Change-Id: I7b052a3f73740ff3a35f38dc2d96bc621b8d8deb
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/collator/collator_unicode.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx
index 40b5c47ab798..a7cf05ba389a 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 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
/** 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();