[Libreoffice-commits] core.git: Branch 'libreoffice-4-1-0' - sc/source

Michael Stahl mstahl at redhat.com
Mon Jul 15 12:38:22 PDT 2013


 sc/source/filter/oox/unitconverter.cxx |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit b47bd8d1acf8fb173fd1faeaccc193c8dabd2e25
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Jul 15 20:22:01 2013 +0200

    sc: fix Date/DateTime ambiguity
    
    (cherry picked from commit 585d4c165f25a6acb19b5f0d05cbb1623283717f)
    
    Change-Id: I99908a73d38b0d4b9919ac9c627b849b1d7de0d8
    Signed-off-by: Eike Rathke <erack at redhat.com>
    Signed-off-by: Norbert Thiebaud <nthiebaud at gmail.com>
    (cherry picked from commit bb19a11fa9a52512bf16cc6cace4c5c10fdb8eb6)

diff --git a/sc/source/filter/oox/unitconverter.cxx b/sc/source/filter/oox/unitconverter.cxx
index 0db4541..55ba77f 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 );
 


More information about the Libreoffice-commits mailing list