summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-09-07 21:04:43 +0200
committerCaolán McNamara <caolanm@redhat.com>2016-09-09 11:53:28 +0000
commit7f037e2230d059320aff8610b6d24c0a44a71e41 (patch)
tree171abf8c007ee17a97f9a16f833001ac5893ad0a /xmloff
parent69885cb07b7cc8290946c97d45f0b7379dcf77b1 (diff)
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@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlnumfi.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 3120bea98a99..bf9ab75fc33b 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 >(