[Libreoffice-commits] core.git: xmloff/source
Eike Rathke (via logerrit)
logerrit at kemper.freedesktop.org
Sat Apr 10 01:50:26 UTC 2021
xmloff/source/style/xmlnumfi.cxx | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
New commits:
commit 5d1042cbd25b22babaf8b30bc4edff6f70750b5e
Author: Eike Rathke <erack at redhat.com>
AuthorDate: Sat Apr 10 00:16:15 2021 +0200
Commit: Eike Rathke <erack at redhat.com>
CommitDate: Sat Apr 10 03:49:37 2021 +0200
ODF load: use AAA/AAAA instead of NN/NNN(N) for implicit secondary calendar
For example ja-JP Gengou calendar.
NN/NNN always worked because ja-JP Gregorian calendar defines the
same day of week names so it never was apparent.
Change-Id: Ief0d7ce7532b7ed7d58910bf150b190b7872db28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113900
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Jenkins
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 28dbe6574336..3928b6788af1 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -955,11 +955,26 @@ void SvXMLNumFmtElementContext::endFastElement(sal_Int32 )
// HasEra flag is set
break;
case SvXMLStyleTokens::DayOfWeek:
- rParent.UpdateCalendar( sCalendar );
//! I18N doesn't provide SYSTEM or extended date information yet
- rParent.AddNfKeyword(
- sal::static_int_cast< sal_uInt16 >(
- bEffLong ? NF_KEY_NNNN : NF_KEY_NN ) );
+ {
+ // Implicit secondary calendar uses A keyword, default and
+ // explicit calendar N keyword.
+ rParent.UpdateCalendar( sCalendar);
+ const SvXMLNumFormatContext::ImplicitCalendar eCal = rParent.GetImplicitCalendarState();
+ if (eCal == SvXMLNumFormatContext::ImplicitCalendar::SECONDARY
+ || eCal == SvXMLNumFormatContext::ImplicitCalendar::SECONDARY_FROM_OTHER)
+ {
+ rParent.AddNfKeyword(
+ sal::static_int_cast< sal_uInt16 >(
+ bEffLong ? NF_KEY_AAAA : NF_KEY_AAA ) );
+ }
+ else
+ {
+ rParent.AddNfKeyword(
+ sal::static_int_cast< sal_uInt16 >(
+ bEffLong ? NF_KEY_NNNN : NF_KEY_NN ) );
+ }
+ }
break;
case SvXMLStyleTokens::WeekOfYear:
rParent.UpdateCalendar( sCalendar );
More information about the Libreoffice-commits
mailing list