diff options
author | Eike Rathke <erack@redhat.com> | 2019-06-19 23:03:49 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2019-06-20 11:27:20 +0200 |
commit | a9c02d543987a0c05beda19905ccd6fb4263b592 (patch) | |
tree | 9a9d974383787f937196a974446402bc9fe04068 /unotools | |
parent | 79e6e4eef098d841eb639f21a905b10bc5db7d56 (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
(cherry picked from commit 942de6a01ba990e5f3bc55ce4ab3737a03f67f39)
Reviewed-on: https://gerrit.libreoffice.org/74399
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/i18n/calendarwrapper.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/unotools/source/i18n/calendarwrapper.cxx b/unotools/source/i18n/calendarwrapper.cxx index dd58a9d1196d..80e3fd1ec295 100644 --- a/unotools/source/i18n/calendarwrapper.cxx +++ b/unotools/source/i18n/calendarwrapper.cxx @@ -38,12 +38,12 @@ CalendarWrapper::~CalendarWrapper() { } -void CalendarWrapper::loadDefaultCalendar( const css::lang::Locale& rLocale ) +void CalendarWrapper::loadDefaultCalendar( const css::lang::Locale& rLocale, bool bTimeZoneUTC ) { try { if ( xC.is() ) - xC->loadDefaultCalendar( rLocale ); + xC->loadDefaultCalendarTZ( rLocale, (bTimeZoneUTC ? "UTC" : OUString())); } catch (const Exception& e) { @@ -51,12 +51,12 @@ void CalendarWrapper::loadDefaultCalendar( const css::lang::Locale& rLocale ) } } -void CalendarWrapper::loadCalendar( const OUString& rUniqueID, const css::lang::Locale& rLocale ) +void CalendarWrapper::loadCalendar( const OUString& rUniqueID, const css::lang::Locale& rLocale, bool bTimeZoneUTC ) { try { if ( xC.is() ) - xC->loadCalendar( rUniqueID, rLocale ); + xC->loadCalendarTZ( rUniqueID, rLocale, (bTimeZoneUTC ? "UTC" : OUString())); } catch (const Exception& e) { |