[PATCH] use LanguageTagIcu

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


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3670

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/70/3670/1

use LanguageTagIcu

Change-Id: I1e66fa3edb2ddf2b6d6f4cdd25104772ff02c70a
---
M i18npool/source/ordinalsuffix/ordinalsuffix.cxx
1 file changed, 3 insertions(+), 6 deletions(-)



diff --git a/i18npool/source/ordinalsuffix/ordinalsuffix.cxx b/i18npool/source/ordinalsuffix/ordinalsuffix.cxx
index 45306cf..953c886 100644
--- a/i18npool/source/ordinalsuffix/ordinalsuffix.cxx
+++ b/i18npool/source/ordinalsuffix/ordinalsuffix.cxx
@@ -18,14 +18,14 @@
  */
 
 #include <boost/scoped_ptr.hpp>
+#include <i18nlangtag/languagetag.hxx>
+#include <i18nlangtag/languagetagicu.hxx>
 #include <comphelper/processfactory.hxx>
 #include <string.h>
 #include "ordinalsuffix.hxx"
 
 #include <unicode/rbnf.h>
 #include <unicode/normlzr.h>
-
-#define CSTR( ouStr ) OUStringToOString( ouStr, RTL_TEXTENCODING_UTF8 ).getStr( )
 
 using namespace ::com::sun::star::i18n;
 using namespace ::com::sun::star::uno;
@@ -72,10 +72,7 @@
 
     // Get the value from ICU
     UErrorCode nCode = U_ZERO_ERROR;
-    const icu::Locale rIcuLocale(
-            CSTR( aLocale.Language ),
-            CSTR( aLocale.Country ),
-            CSTR( aLocale.Variant ) );
+    const icu::Locale rIcuLocale( LanguageTagIcu::getIcuLocale( LanguageTag( aLocale)));
 
     icu::RuleBasedNumberFormat formatter(icu::URBNF_ORDINAL, rIcuLocale, nCode);
     if (!U_SUCCESS(nCode))

-- 
To view, visit https://gerrit.libreoffice.org/3670
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e66fa3edb2ddf2b6d6f4cdd25104772ff02c70a
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Eike Rathke <erack at redhat.com>



More information about the LibreOffice mailing list