summaryrefslogtreecommitdiff
path: root/include/unotools/calendarwrapper.hxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2019-06-19 23:03:49 +0200
committerEike Rathke <erack@redhat.com>2019-06-20 01:57:20 +0200
commit942de6a01ba990e5f3bc55ce4ab3737a03f67f39 (patch)
treeba95c764124c7075fa8511a2788c8897ade95cc2 /include/unotools/calendarwrapper.hxx
parent36fe1461c5ae7a7db175c77688aaff1a1d12551a (diff)
Resolves: tdf#92503 introduce TimeZone to calendar loading and default to UTC
Without that, the system's time zone was used which on DST transition dates leads to non-existent times when switching to/from DST. As the calendar use and number parser/formatter nor conversions or calculations are time zone aware, using not DST afflicted UTC is the better choice. Change-Id: I3303c6620d8c4b9d081555c8293954fb1bd67895 Reviewed-on: https://gerrit.libreoffice.org/74386 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'include/unotools/calendarwrapper.hxx')
-rw-r--r--include/unotools/calendarwrapper.hxx26
1 files changed, 24 insertions, 2 deletions
diff --git a/include/unotools/calendarwrapper.hxx b/include/unotools/calendarwrapper.hxx
index 149393bb7e84..a81186ae4ba5 100644
--- a/include/unotools/calendarwrapper.hxx
+++ b/include/unotools/calendarwrapper.hxx
@@ -54,8 +54,30 @@ public:
// wrapper implementations of XCalendar
- void loadDefaultCalendar( const css::lang::Locale& rLocale );
- void loadCalendar( const OUString& rUniqueID, const css::lang::Locale& rLocale );
+ /** Load the default calendar of a locale.
+
+ This adds a bool bTimeZoneUTC parameter which is not part of the UNO API to
+ facilitate handling of non time zone aware data.
+
+ @param bTimeZoneUTC
+ Default <TRUE/>. If <FALSE/>, the system's timezone is assigned
+ to the calendar, including all DST quirks like not existing
+ times on DST transition dates when switching to/from DST. As
+ current implementations and number parser/formatter don't store
+ or convert or calculate with time zones it is safer to use UTC,
+ which is not DST afflicted, otherwise surprises are lurking
+ (for example tdf#92503).
+ */
+ void loadDefaultCalendar( const css::lang::Locale& rLocale, bool bTimeZoneUTC = true );
+ /// This adds a bTimeZoneUTC parameter which is not part of the API.
+ void loadCalendar( const OUString& rUniqueID, const css::lang::Locale& rLocale, bool bTimeZoneUTC = true );
+
+ /* XXX NOTE: the time zone taking UNO API functions are not implemented as
+ * wrapper interface as they are not necessary/used so far. These are:
+ void loadDefaultCalendarTZ( const css::lang::Locale& rLocale, const OUString& rTimeZone );
+ void loadCalendarTZ( const OUString& rUniqueID, const css::lang::Locale& rLocale, const OUString& rTimeZone );
+ */
+
css::uno::Sequence< OUString > getAllCalendars( const css::lang::Locale& rLocale ) const;
OUString getUniqueID() const;
/// set UTC date/time