diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-06-28 00:43:19 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-07-15 11:46:41 +0000 |
commit | 652ccbdf3111766fadc379a8cf4650b744e1e19c (patch) | |
tree | 5efdab367c4da4ac6c62ad1e228b77648cc62aed /offapi | |
parent | a8e8d46020702c64ff314adbe87e6f21e73e1999 (diff) |
i#108348 API CHANGE: add IsUTC to css.util.DateTime etc.
Add IsUTC member to:
com.sun.star.util.DateTime
com.sun.star.util.DateTimeRange
com.sun.star.util.Time
Add new stucts with explicit time zones:
com.sun.star.util.DateTimeWithTimezone
com.sun.star.util.DateWithTimezone
com.sun.star.util.TimeWithTimezone
Adapt the sax::Converter to read/write timezones, and fix the unit test.
Everything else just uses default (no time zone), this commit is just
to fix the API.
STRUCT: /UCR/com/sun/star/util/DateTime
nFields1 = 7 != nFields2 = 8
Registry2 contains 1 more fields
STRUCT: /UCR/com/sun/star/util/DateTimeRange
nFields1 = 14 != nFields2 = 15
Registry2 contains 1 more fields
STRUCT: /UCR/com/sun/star/util/Time
nFields1 = 4 != nFields2 = 5
Registry2 contains 1 more fields
Conflicts:
sc/source/filter/oox/unitconverter.cxx
Change-Id: I01f7a6d082a6b090c8efe71d2de137474c495c18
Reviewed-on: https://gerrit.libreoffice.org/4833
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'offapi')
-rw-r--r-- | offapi/UnoApi_offapi.mk | 3 | ||||
-rw-r--r-- | offapi/com/sun/star/util/Date.idl | 3 | ||||
-rw-r--r-- | offapi/com/sun/star/util/DateTime.idl | 7 | ||||
-rw-r--r-- | offapi/com/sun/star/util/DateTimeRange.idl | 8 | ||||
-rw-r--r-- | offapi/com/sun/star/util/DateTimeWithTimezone.idl | 43 | ||||
-rw-r--r-- | offapi/com/sun/star/util/DateWithTimezone.idl | 43 | ||||
-rw-r--r-- | offapi/com/sun/star/util/Time.idl | 7 | ||||
-rw-r--r-- | offapi/com/sun/star/util/TimeWithTimezone.idl | 44 | ||||
-rw-r--r-- | offapi/type_reference/offapi.rdb | bin | 6824448 -> 6822400 bytes |
9 files changed, 152 insertions, 6 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 5a7f329e19e6..174c03b1adb2 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -4035,7 +4035,9 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/util,\ DataEditorEvent \ DataEditorEventType \ Date \ + DateWithTimezone \ DateTime \ + DateTimeWithTimezone \ DateTimeRange \ Duration \ ElementChange \ @@ -4056,6 +4058,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/util,\ SortField \ SortFieldType \ Time \ + TimeWithTimezone \ TriState \ URL \ VetoException \ diff --git a/offapi/com/sun/star/util/Date.idl b/offapi/com/sun/star/util/Date.idl index ecbda5a8b307..796a6325be63 100644 --- a/offapi/com/sun/star/util/Date.idl +++ b/offapi/com/sun/star/util/Date.idl @@ -20,11 +20,12 @@ #define __com_sun_star_util_Date_idl__ - module com { module sun { module star { module util { /** represents a date value. + + The time zone is unknown. */ published struct Date { diff --git a/offapi/com/sun/star/util/DateTime.idl b/offapi/com/sun/star/util/DateTime.idl index 312589f9eb73..68793ee7feaf 100644 --- a/offapi/com/sun/star/util/DateTime.idl +++ b/offapi/com/sun/star/util/DateTime.idl @@ -20,7 +20,6 @@ #define __com_sun_star_util_DateTime_idl__ - module com { module sun { module star { module util { @@ -61,7 +60,11 @@ published struct DateTime */ short Year; - /** TODO: timezone **/ + /** true: time zone is UTC false: unknown time zone. + + @since LibreOffice 4.1 + */ + boolean IsUTC; }; diff --git a/offapi/com/sun/star/util/DateTimeRange.idl b/offapi/com/sun/star/util/DateTimeRange.idl index b56a0484e494..60ea92bf8c84 100644 --- a/offapi/com/sun/star/util/DateTimeRange.idl +++ b/offapi/com/sun/star/util/DateTimeRange.idl @@ -20,7 +20,6 @@ #define __com_sun_star_util_DateTimeRange_idl__ - module com { module sun { module star { module util { @@ -84,7 +83,12 @@ published struct DateTimeRange */ short EndYear; - /** TODO timezones **/ + /** true: time zone is UTC false: unknown time zone. + + @since LibreOffice 4.1 + */ + boolean IsUTC; + }; diff --git a/offapi/com/sun/star/util/DateTimeWithTimezone.idl b/offapi/com/sun/star/util/DateTimeWithTimezone.idl new file mode 100644 index 000000000000..6f40e6b3beb9 --- /dev/null +++ b/offapi/com/sun/star/util/DateTimeWithTimezone.idl @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef __com_sun_star_util_DateTimeTZ_idl__ +#define __com_sun_star_util_DateTimeTZ_idl__ + +#include <com/sun/star/util/DateTime.idl> + + +module com { module sun { module star { module util { + +/** represents a combined date+time value with time zone. + + @since LibreOffice 4.1 + */ +struct DateTimeWithTimeZone +{ + /** the date and time (in TimeZone) + */ + DateTime DateTimeInTZ; + + /** contains the time zone, as signed offset in minutes *from* UTC, + that is *east* of UTC, that is the amount of minutes that should + be added to UTC time to obtain the time in that timezone. + + To obtain UTC datetime from DateTimeInTZ, you need to *subtract* + TimeZone minutes. + */ + short Timezone; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/util/DateWithTimezone.idl b/offapi/com/sun/star/util/DateWithTimezone.idl new file mode 100644 index 000000000000..928a9c43de59 --- /dev/null +++ b/offapi/com/sun/star/util/DateWithTimezone.idl @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef __com_sun_star_util_DateTZ_idl__ +#define __com_sun_star_util_DateTZ_idl__ + +#include <com/sun/star/util/Date.idl> + + +module com { module sun { module star { module util { + +/** represents a date value with time zone. + + @since LibreOffice 4.1 + */ +struct DateWithTimeZone +{ + /** the date. + @note XMLSchema-2 defines this as a 24 hour interval. + The TimeZone shifts the interval along the UTC time line. + */ + Date DateInTZ; + + /** contains the time zone, as signed offset in minutes *from* UTC, + that is *east* of UTC, that is the amount of minutes that should + be added to UTC time to obtain time in that timezone. + */ + short Timezone; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ + diff --git a/offapi/com/sun/star/util/Time.idl b/offapi/com/sun/star/util/Time.idl index 1ac850f31797..5bf0b9d57450 100644 --- a/offapi/com/sun/star/util/Time.idl +++ b/offapi/com/sun/star/util/Time.idl @@ -20,7 +20,6 @@ #define __com_sun_star_util_Time_idl__ - module com { module sun { module star { module util { @@ -44,6 +43,12 @@ published struct Time */ unsigned short Hours; + /** true: time zone is UTC false: unknown time zone. + + @since LibreOffice 4.1 + */ + boolean IsUTC; + }; diff --git a/offapi/com/sun/star/util/TimeWithTimezone.idl b/offapi/com/sun/star/util/TimeWithTimezone.idl new file mode 100644 index 000000000000..042ff8308ebf --- /dev/null +++ b/offapi/com/sun/star/util/TimeWithTimezone.idl @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef __com_sun_star_util_TimeTZ_idl__ +#define __com_sun_star_util_TimeTZ_idl__ + +#include <com/sun/star/util/Time.idl> + + +module com { module sun { module star { module util { + +/** represents a combined time value with time zone. + + @since LibreOffice 4.1 + */ +struct TimeWithTimeZone +{ + /** the time (in TimeZone) + */ + Time TimeInTZ; + + /** contains the time zone, as signed offset in minutes *from* UTC, + that is *east* of UTC, that is the amount of minutes that should + be added to UTC time to obtain the time in that timezone. + + To obtain UTC time from TimeInTZ, you need to *subtract* TimeZone + minutes. + */ + short Timezone; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ + diff --git a/offapi/type_reference/offapi.rdb b/offapi/type_reference/offapi.rdb Binary files differindex 7c06f1a2c131..fd83b2292aa3 100644 --- a/offapi/type_reference/offapi.rdb +++ b/offapi/type_reference/offapi.rdb |