[PATCH] use LanguageTagIcu
Eike Rathke (via Code Review)
gerrit at gerrit.libreoffice.org
Mon Apr 29 06:16:46 PDT 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3666
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/66/3666/1
use LanguageTagIcu
Change-Id: I048d72c0cd633e3aa9e6a74e4f111703969b1d77
---
M lotuswordpro/Library_lwpft.mk
M lotuswordpro/source/filter/lwptools.cxx
2 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/lotuswordpro/Library_lwpft.mk b/lotuswordpro/Library_lwpft.mk
index f01261d..7673eb3 100644
--- a/lotuswordpro/Library_lwpft.mk
+++ b/lotuswordpro/Library_lwpft.mk
@@ -17,6 +17,7 @@
cppuhelper \
sal \
i18nlangtag \
+ i18nlangtagicu \
sfx \
sot \
svt \
diff --git a/lotuswordpro/source/filter/lwptools.cxx b/lotuswordpro/source/filter/lwptools.cxx
index dd723cc..9ef4ec5 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 @@
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 @@
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;
--
To view, visit https://gerrit.libreoffice.org/3666
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I048d72c0cd633e3aa9e6a74e4f111703969b1d77
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Eike Rathke <erack at redhat.com>
More information about the LibreOffice
mailing list