xmloff/source/style/xmlnumfi.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit ccfbc9d3ac83fa238d6240b5365dc7572c64d241 Author: Eike Rathke <er...@redhat.com> Date: Tue Sep 13 22:05:09 2016 +0200 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 diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 257d945..7d1db52 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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits