xmloff/source/style/xmlnumfi.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
New commits: commit 95c91f098e8974c41c8d403a351fe53db6822165 Author: Eike Rathke <er...@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 diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 8c2b8e7..35ea3a7 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -1215,11 +1215,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 >( _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits