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@redhat.com>
Context
- [PATCH] use LanguageTagIcu · Eike Rathke (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.