summaryrefslogtreecommitdiff
path: root/unotools
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 /unotools
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 'unotools')
-rw-r--r--unotools/source/i18n/calendarwrapper.cxx8
1 files changed, 4 insertions, 4 deletions
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&)
{