summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2021-03-13 00:07:48 +0100
committerEike Rathke <erack@redhat.com>2021-03-13 15:41:42 +0100
commite6d41f285617e4b867042afac5d3d92aa54e8e4c (patch)
treec935cc0fbf43169d87c055933fe673a6aa23b46e /xmloff
parent8f669800d09643e81f6789dfcb06ac7ef20725ee (diff)
ODF load: replace YY/YYYY with E/EE only for secondary calendar
In the context of Gengou calendar with Era a [~gregorian]YYYY should not be [~gregorian]EE (although it works and displays the same Gregorian year). Related to https://gerrit.libreoffice.org/c/core/+/108532 Change-Id: Iaec55c997089cbaea424220d858bffdf20ff3706 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112406 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlnumfi.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index b33715726b92..734f572608b1 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -931,7 +931,8 @@ void SvXMLNumFmtElementContext::endFastElement(sal_Int32 )
// calendar of a locale if it is known to implicitly use E.
bool bImplicitEC = (!sCalendar.isEmpty() &&
rParent.GetLocaleData().doesSecondaryCalendarUseEC( sCalendar));
- if (bImplicitEC || (!sCalendar.isEmpty() && rParent.HasEra()))
+ if (bImplicitEC || (!sCalendar.isEmpty() && rParent.HasEra()
+ && sCalendar != rParent.GetLocaleData().getDefaultCalendar()->Name))
{
// If E or EE is the first format keyword, passing
// bImplicitEC=true suppresses the superfluous calendar