From 942de6a01ba990e5f3bc55ce4ab3737a03f67f39 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Wed, 19 Jun 2019 23:03:49 +0200 Subject: 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 Tested-by: Jenkins --- unotools/source/i18n/calendarwrapper.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'unotools') diff --git a/unotools/source/i18n/calendarwrapper.cxx b/unotools/source/i18n/calendarwrapper.cxx index 6e755be3bd36..5f4a1669bccf 100644 --- a/unotools/source/i18n/calendarwrapper.cxx +++ b/unotools/source/i18n/calendarwrapper.cxx @@ -39,12 +39,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&) { @@ -52,12 +52,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&) { -- cgit