summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-07-15 20:22:01 +0200
committerMichael Stahl <mstahl@redhat.com>2013-07-15 21:30:14 +0200
commitbb19a11fa9a52512bf16cc6cace4c5c10fdb8eb6 (patch)
treed91365bace223f5a8312f699987d16d7d89a8e95 /sc
parentb9228ac1e94b24a44828e4cecf26ee5faf178cd6 (diff)
sc: fix Date/DateTime ambiguity
(cherry picked from commit 585d4c165f25a6acb19b5f0d05cbb1623283717f) Change-Id: I99908a73d38b0d4b9919ac9c627b849b1d7de0d8 Signed-off-by: Eike Rathke <erack@redhat.com> Signed-off-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/oox/unitconverter.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/filter/oox/unitconverter.cxx b/sc/source/filter/oox/unitconverter.cxx
index 0db45415fdec..55ba77fe15e3 100644
--- a/sc/source/filter/oox/unitconverter.cxx
+++ b/sc/source/filter/oox/unitconverter.cxx
@@ -36,9 +36,9 @@ namespace xls {
// ============================================================================
+using namespace ::com::sun::star;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::util;
// ============================================================================
@@ -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 Date& rDate )
+sal_Int32 lclGetDays( const util::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 Date& rDate )
UnitConverter::UnitConverter( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper ),
maCoeffs( UNIT_ENUM_SIZE, 1.0 ),
- mnNullDate( lclGetDays( Date( 30, 12, 1899 ) ) )
+ mnNullDate( lclGetDays( util::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 Date& rNullDate )
+void UnitConverter::finalizeNullDate( const util::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 DateTime& rDateTime ) const
+double UnitConverter::calcSerialFromDateTime( const util::DateTime& rDateTime ) const
{
- sal_Int32 nDays = lclGetDays( Date( rDateTime.Day, rDateTime.Month, rDateTime.Year ) ) - mnNullDate;
+ sal_Int32 nDays = lclGetDays( util::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;
}
-DateTime UnitConverter::calcDateTimeFromSerial( double fSerial ) const
+util::DateTime UnitConverter::calcDateTimeFromSerial( double fSerial ) const
{
- DateTime aDateTime( 0, 0, 0, 0, 1, 1, 0, false );
+ util::DateTime aDateTime( 0, 0, 0, 0, 1, 1, 0, false );
double fDays = 0.0;
double fTime = modf( fSerial, &fDays );