summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/ordinalsuffix/ordinalsuffix.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/i18npool/source/ordinalsuffix/ordinalsuffix.cxx b/i18npool/source/ordinalsuffix/ordinalsuffix.cxx
index 45306cfe52c9..953c8868eee4 100644
--- a/i18npool/source/ordinalsuffix/ordinalsuffix.cxx
+++ b/i18npool/source/ordinalsuffix/ordinalsuffix.cxx
@@ -18,6 +18,8 @@
*/
#include <boost/scoped_ptr.hpp>
+#include <i18nlangtag/languagetag.hxx>
+#include <i18nlangtag/languagetagicu.hxx>
#include <comphelper/processfactory.hxx>
#include <string.h>
#include "ordinalsuffix.hxx"
@@ -25,8 +27,6 @@
#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;
using namespace ::com::sun::star;
@@ -72,10 +72,7 @@ uno::Sequence< OUString > SAL_CALL OrdinalSuffix::getOrdinalSuffix( sal_Int32 nN
// 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))