From 010d6d1562f309a2aee728f8e5590385cc6ce8fd Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Tue, 16 Mar 2021 21:12:29 +0100 Subject: ODF load: suppress calendar modifiers in format codes if possible ... for switching to/from implicit secondary calendar, like ja-JP explicit [~gengou] and [~gregorian] most times are superfluous and GE or YYYY are used. In preparation for https://gerrit.libreoffice.org/c/core/+/108532 Change-Id: I8eb412c0fbba0927741bb305f91eb575b5f1bb13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112596 Reviewed-by: Eike Rathke Tested-by: Jenkins --- include/xmloff/xmlnumfi.hxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/xmloff/xmlnumfi.hxx b/include/xmloff/xmlnumfi.hxx index 1bf6c9228ed6..c863304bc293 100644 --- a/include/xmloff/xmlnumfi.hxx +++ b/include/xmloff/xmlnumfi.hxx @@ -115,6 +115,18 @@ struct MyCondition class XMLOFF_DLLPUBLIC SvXMLNumFormatContext : public SvXMLStyleContext { +public: + enum ImplicitCalendar + { + DEFAULT, + SECONDARY, + OTHER, + DEFAULT_FROM_OTHER, + SECONDARY_FROM_OTHER + }; + +private: + SvXMLNumImpData* pData; SvXMLStylesContext* pStyles; std::vector aMyConditions; @@ -124,6 +136,8 @@ class XMLOFF_DLLPUBLIC SvXMLNumFormatContext : public SvXMLStyleContext OUString sFormatTitle; // OUString sMapName; OUString sCalendar; + OUString aImplicitCalendar[2]; + ImplicitCalendar eImplicitCalendar; LanguageType nFormatLang; bool bAutoOrder; bool bFromSystem; @@ -178,7 +192,8 @@ public: void SetHasLongDoW(bool bSet) { bHasLongDoW = bSet; } bool HasEra() const { return bHasEra; } - void UpdateCalendar( const OUString& rNewCalendar, bool bImplicitSecondaryCalendarEC = false ); + void UpdateCalendar( const OUString& rNewCalendar ); + ImplicitCalendar GetImplicitCalendarState() const { return eImplicitCalendar; } const LocaleDataWrapper& GetLocaleData() const; -- cgit