summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-09-13 22:05:09 +0200
committerEike Rathke <erack@redhat.com>2016-09-13 22:10:01 +0200
commitccfbc9d3ac83fa238d6240b5365dc7572c64d241 (patch)
tree7a04f844575f467cc20e6c29a7bfa255ddae4d9f /xmloff
parent4e7b0af6244d89c523868ef508f4bb254085672e (diff)
unconditionally replacing Y after G (era) with E was always wrong
For example, in en-US locale G MM/DD/YYYY saved and reloaded lead to G MM/DD/EE using the Hebrew calendar. Use E or EE only if a secondary calendar was given. Change-Id: I6db22e89f435342aa4a1bce7fa13711c138007f5
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlnumfi.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 257d945efef1..7d1db52a5eb0 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1203,11 +1203,13 @@ void SvXMLNumFmtElementContext::EndElement()
case XML_TOK_STYLE_YEAR:
//! I18N doesn't provide SYSTEM or extended date information yet
{
- // Y after G (era) is replaced by E, also if we're switching to the
- // other second known calendar for a locale.
+ // Y after G (era) is replaced by E for a secondary calendar.
+ // Do not replace for default calendar.
+ // Also replace Y by E if we're switching to the secondary
+ // calendar of a locale if it is known to implicitly use E.
bool bImplicitEC = (!sCalendar.isEmpty() &&
rParent.GetLocaleData().doesSecondaryCalendarUseEC( sCalendar));
- if (rParent.HasEra() || bImplicitEC)
+ if (bImplicitEC || (!sCalendar.isEmpty() && rParent.HasEra()))
{
// If E or EE is the first format keyword, passing
// bImplicitEC=true suppresses the superfluous calendar