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 /sc | |
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 'sc')
-rw-r--r-- | sc/source/filter/oox/unitconverter.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sc/source/filter/oox/unitconverter.cxx b/sc/source/filter/oox/unitconverter.cxx index 780168c9760e..0db45415fdec 100644 --- a/sc/source/filter/oox/unitconverter.cxx +++ b/sc/source/filter/oox/unitconverter.cxx @@ -67,7 +67,7 @@ void lclSkipYearBlock( sal_Int32& ornDays, sal_Int16& ornYear, sal_Int32 nDaysIn /** Returns the number of days before the passed date, starting from the null date 0000-Jan-01, using standard leap year conventions. */ -sal_Int32 lclGetDays( const css::util::Date& rDate ) +sal_Int32 lclGetDays( const Date& rDate ) { // number of days in all full years before passed date including all leap days sal_Int32 nDays = rDate.Year * 365 + ((rDate.Year + 3) / 4) - ((rDate.Year + 99) / 100) + ((rDate.Year + 399) / 400); @@ -98,7 +98,7 @@ sal_Int32 lclGetDays( const css::util::Date& rDate ) UnitConverter::UnitConverter( const WorkbookHelper& rHelper ) : WorkbookHelper( rHelper ), maCoeffs( UNIT_ENUM_SIZE, 1.0 ), - mnNullDate( lclGetDays( css::util::Date( 30, 12, 1899 ) ) ) + mnNullDate( lclGetDays( Date( 30, 12, 1899 ) ) ) { // initialize constant and default coefficients const DeviceInfo& rDeviceInfo = getBaseFilter().getGraphicHelper().getDeviceInfo(); @@ -157,7 +157,7 @@ void UnitConverter::finalizeImport() } } -void UnitConverter::finalizeNullDate( const css::util::Date& rNullDate ) +void UnitConverter::finalizeNullDate( const Date& rNullDate ) { // convert the nulldate to number of days since 0000-Jan-01 mnNullDate = lclGetDays( rNullDate ); @@ -180,17 +180,17 @@ double UnitConverter::scaleFromMm100( sal_Int32 nMm100, Unit eUnit ) const return static_cast< double >( nMm100 ) / getCoefficient( eUnit ); } -double UnitConverter::calcSerialFromDateTime( const css::util::DateTime& rDateTime ) const +double UnitConverter::calcSerialFromDateTime( const DateTime& rDateTime ) const { - sal_Int32 nDays = lclGetDays( css::util::Date( rDateTime.Day, rDateTime.Month, rDateTime.Year ) ) - mnNullDate; + sal_Int32 nDays = lclGetDays( Date( rDateTime.Day, rDateTime.Month, rDateTime.Year ) ) - mnNullDate; OSL_ENSURE( nDays >= 0, "UnitConverter::calcDateTimeSerial - invalid date" ); OSL_ENSURE( (rDateTime.Hours <= 23) && (rDateTime.Minutes <= 59) && (rDateTime.Seconds <= 59), "UnitConverter::calcDateTimeSerial - invalid time" ); return nDays + rDateTime.Hours / 24.0 + rDateTime.Minutes / 1440.0 + rDateTime.Seconds / 86400.0; } -css::util::DateTime UnitConverter::calcDateTimeFromSerial( double fSerial ) const +DateTime UnitConverter::calcDateTimeFromSerial( double fSerial ) const { - css::util::DateTime aDateTime( 0, 0, 0, 0, 1, 1, 0 ); + DateTime aDateTime( 0, 0, 0, 0, 1, 1, 0, false ); double fDays = 0.0; double fTime = modf( fSerial, &fDays ); |