diff options
author | Eike Rathke <erack@redhat.com> | 2013-04-24 23:07:13 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-04-24 23:10:31 +0200 |
commit | 56e753aa6a762337ec09bd30445ad4b75c3bf5fe (patch) | |
tree | dae3987088f678ba96ed89cb0a49586980bb4516 /lotuswordpro | |
parent | 095f3dde425eb79da0e7fbfe40e18de1ac4f368b (diff) |
use LanguageTagIcu
Change-Id: I048d72c0cd633e3aa9e6a74e4f111703969b1d77
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/Library_lwpft.mk | 1 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwptools.cxx | 21 |
2 files changed, 7 insertions, 15 deletions
diff --git a/lotuswordpro/Library_lwpft.mk b/lotuswordpro/Library_lwpft.mk index f01261d12878..7673eb340f75 100644 --- a/lotuswordpro/Library_lwpft.mk +++ b/lotuswordpro/Library_lwpft.mk @@ -17,6 +17,7 @@ $(eval $(call gb_Library_use_libraries,lwpft,\ cppuhelper \ sal \ i18nlangtag \ + i18nlangtagicu \ sfx \ sot \ svt \ diff --git a/lotuswordpro/source/filter/lwptools.cxx b/lotuswordpro/source/filter/lwptools.cxx index dd723cc42816..9ef4ec577e39 100644 --- a/lotuswordpro/source/filter/lwptools.cxx +++ b/lotuswordpro/source/filter/lwptools.cxx @@ -71,6 +71,7 @@ #include <vcl/settings.hxx> #include <unicode/datefmt.h> #include <unicode/udat.h> +#include <i18nlangtag/languagetagicu.hxx> #ifdef SAL_UNX #define SEPARATOR '/' @@ -284,15 +285,10 @@ XFDateStyle* LwpTools::GetSystemDateStyle(sal_Bool bLongFormat) udat_toPattern(fmt,true,pattern,nLength,&status); } */ - /* FIXME-BCP47: handle language tags! */ //1 get locale for system - ::com::sun::star::lang::Locale aLocale=Application::GetSettings().GetLanguageTag().getLocale(); - OUString strLang = aLocale.Language; - OUString strCountry = aLocale.Country; - icu::Locale bLocale((char*)(OUStringToOString(strLang,RTL_TEXTENCODING_MS_1252).getStr()), - (char*)(OUStringToOString(strCountry,RTL_TEXTENCODING_MS_1252).getStr())); + icu::Locale aLocale( LanguageTagIcu::getIcuLocale( Application::GetSettings().GetLanguageTag())); //2 get icu format pattern by locale - icu::DateFormat* fmt = icu::DateFormat::createDateInstance(style,bLocale); + icu::DateFormat* fmt = icu::DateFormat::createDateInstance(style,aLocale); int32_t nLength = 0; int32_t nLengthNeed; @@ -698,16 +694,11 @@ XFTimeStyle* LwpTools::GetSystemTimeStyle() udat_toPattern(fmt,true,pattern,nLength,&status); } */ - /* FIXME-BCP47: handle language tags! */ //1 get locale for system - ::com::sun::star::lang::Locale aLocale=Application::GetSettings().GetLanguageTag().getLocale(); - OUString strLang = aLocale.Language; - OUString strCountry = aLocale.Country; - icu::Locale bLocale((char*)(OUStringToOString(strLang,RTL_TEXTENCODING_MS_1252).getStr()), - (char*)(OUStringToOString(strCountry,RTL_TEXTENCODING_MS_1252).getStr())); - - icu::DateFormat* fmt = icu::DateFormat::createTimeInstance(icu::DateFormat::DEFAULT,bLocale); + icu::Locale aLocale( LanguageTagIcu::getIcuLocale( Application::GetSettings().GetLanguageTag())); //2 get icu format pattern by locale + icu::DateFormat* fmt = icu::DateFormat::createTimeInstance(icu::DateFormat::DEFAULT,aLocale); + int32_t nLength = 0; int32_t nLengthNeed; UErrorCode status = U_ZERO_ERROR; |