[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - xmloff/source
Eike Rathke
erack at redhat.com
Fri Sep 9 11:53:56 UTC 2016
xmloff/source/style/xmlnumfi.cxx | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 7f037e2230d059320aff8610b6d24c0a44a71e41
Author: Eike Rathke <erack at redhat.com>
Date: Wed Sep 7 21:04:43 2016 +0200
Resolves: tdf#101963 loading zh-TW ROC calendar use EE|E instead of YYYY|YY
This still (unnecessarily) prefixes with [~ROC] but preserves the
intended "no leading zero" semantics.
Change-Id: I154be0978a8147ceddefcb546c257d44f770b5de
(cherry picked from commit 95c91f098e8974c41c8d403a351fe53db6822165)
Reviewed-on: https://gerrit.libreoffice.org/28732
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 3120bea..bf9ab75 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1135,11 +1135,17 @@ void SvXMLNumFmtElementContext::EndElement()
case XML_TOK_STYLE_YEAR:
rParent.UpdateCalendar( sCalendar );
//! I18N doesn't provide SYSTEM or extended date information yet
- // Y after G (era) is replaced by E
- if ( rParent.HasEra() )
+ // Y after G (era) is replaced by E, also if we're switching to the
+ // other second known calendar for a locale.
+ /* TODO: here only for zh-TW, handle for other locales as well. */
+ if ( rParent.HasEra() ||
+ (sCalendar.equalsIgnoreAsciiCaseAscii("ROC") &&
+ rParent.GetLocaleData().getLoadedLanguageTag().getBcp47() == "zh-TW"))
+ {
rParent.AddNfKeyword(
sal::static_int_cast< sal_uInt16 >(
bEffLong ? NF_KEY_EEC : NF_KEY_EC ) );
+ }
else
rParent.AddNfKeyword(
sal::static_int_cast< sal_uInt16 >(
More information about the Libreoffice-commits
mailing list