summaryrefslogtreecommitdiffstats
path: root/i18npool/inc
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 /i18npool/inc
parentColibre: Fix wrong master/page, remove uneccessary extra bold line (diff)
downloadcore-942de6a01ba990e5f3bc55ce4ab3737a03f67f39.tar.gz
core-942de6a01ba990e5f3bc55ce4ab3737a03f67f39.zip
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 'i18npool/inc')
-rw-r--r--i18npool/inc/calendarImpl.hxx8
-rw-r--r--i18npool/inc/calendar_gregorian.hxx1
2 files changed, 6 insertions, 3 deletions
diff --git a/i18npool/inc/calendarImpl.hxx b/i18npool/inc/calendarImpl.hxx
index b35decb0f750..299bfe79bae2 100644
--- a/i18npool/inc/calendarImpl.hxx
+++ b/i18npool/inc/calendarImpl.hxx
@@ -84,6 +84,8 @@ public:
// XCalendar4
virtual void SAL_CALL setLocalDateTime(double TimeInDays) override;
virtual double SAL_CALL getLocalDateTime() override;
+ virtual void SAL_CALL loadDefaultCalendarTZ(const css::lang::Locale& rLocale, const OUString& rTimeZone) override;
+ virtual void SAL_CALL loadCalendarTZ(const OUString& uniqueID, const css::lang::Locale& rLocale, const OUString& rTimeZone) override;
//XServiceInfo
virtual OUString SAL_CALL getImplementationName() override;
@@ -92,9 +94,9 @@ public:
private:
struct lookupTableItem {
- lookupTableItem(const OUString& _uniqueID, css::uno::Reference < css::i18n::XCalendar4 > const & _xCalendar)
- : uniqueID(_uniqueID), xCalendar(_xCalendar) {}
- OUString uniqueID;
+ lookupTableItem(const OUString& rCacheID, css::uno::Reference < css::i18n::XCalendar4 > const & _xCalendar)
+ : m_aCacheID(rCacheID), xCalendar(_xCalendar) {}
+ OUString m_aCacheID;
css::uno::Reference < css::i18n::XCalendar4 > xCalendar;
};
std::vector<lookupTableItem> lookupTable;
diff --git a/i18npool/inc/calendar_gregorian.hxx b/i18npool/inc/calendar_gregorian.hxx
index 894f2246e30b..aa9a02965d79 100644
--- a/i18npool/inc/calendar_gregorian.hxx
+++ b/i18npool/inc/calendar_gregorian.hxx
@@ -54,6 +54,7 @@ public:
Calendar_gregorian();
Calendar_gregorian(const Era *_eraArray);
void init(const Era *_eraArray);
+ bool setTimeZone( const OUString& rTimeZone );
/**
* Destructor