diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-03-17 08:36:26 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-04-18 21:34:46 +0200 |
commit | 9830fd36dbdb72c79703b0c61efc027fba793c5a (patch) | |
tree | 2e9d698e6ca109dc6627adb5c84aa2b635bcfe92 /sw | |
parent | 5aaaf0694b6e3213685563fc3bc90d19b10f5c75 (diff) |
date/time IDL datatypes incompatible change
- nanosecond precision
- signed (allowed negative) year
Also: assorted improvements / bugfixes in date/time handling code.
Some factorisation of copy/pasted code.
Change-Id: I761a1b0b8731c82f19a0c37acbcf43d3c06d6cd6
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/doccomp.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docglbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docredln.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/fields/docufld.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/fields/flddat.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/swunohelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoredline.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/xml/XMLRedlineImportHelper.cxx | 2 |
10 files changed, 19 insertions, 19 deletions
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index fc896f3c4a06..fc5ad2ba4203 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -1654,7 +1654,7 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo ) ? xDocProps->getCreationDate() : xDocProps->getModificationDate() ); Date d(uDT.Day, uDT.Month, uDT.Year); - Time t(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.HundredthSeconds); + Time t(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds); DateTime aDT(d,t); if( aTmp.Len() ) diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 5c0eb98509cc..58dd0333b0b2 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -272,7 +272,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, bool bOutline, c OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties"); // the GlobalDoc is the template xDocProps->setTemplateName(aEmptyStr); - ::util::DateTime uDT(aTmplDate.Get100Sec(), + ::util::DateTime uDT(aTmplDate.GetNanoSec(), aTmplDate.GetSec(), aTmplDate.GetMin(), aTmplDate.GetHour(), aTmplDate.GetDay(), aTmplDate.GetMonth(), aTmplDate.GetYear()); diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 5c2cdf00bfad..6f3e18b222ec 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -2994,7 +2994,7 @@ SwRedlineData::SwRedlineData( RedlineType_t eT, sal_uInt16 nAut ) eType( eT ), nAuthor( nAut ), nSeqNo( 0 ) { aStamp.SetSec( 0 ); - aStamp.Set100Sec( 0 ); + aStamp.SetNanoSec( 0 ); } SwRedlineData::SwRedlineData( const SwRedlineData& rCpy, sal_Bool bCpyNext ) diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 5783b506aae9..eee6211c0328 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -973,7 +973,7 @@ String SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat, String aName( xDocProps->getAuthor() ); util::DateTime uDT( xDocProps->getCreationDate() ); Date aD(uDT.Day, uDT.Month, uDT.Year); - Time aT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.HundredthSeconds); + Time aT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds); DateTime aDate(aD,aT); if( nSub == DI_CREATE ) ; // das wars schon!! @@ -982,7 +982,7 @@ String SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat, aName = xDocProps->getModifiedBy(); uDT = xDocProps->getModificationDate(); Date bD(uDT.Day, uDT.Month, uDT.Year); - Time bT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.HundredthSeconds); + Time bT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds); DateTime bDate(bD,bT); aDate = bDate; } @@ -991,7 +991,7 @@ String SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat, aName = xDocProps->getPrintedBy(); uDT = xDocProps->getPrintDate(); Date bD(uDT.Day, uDT.Month, uDT.Year); - Time bT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.HundredthSeconds); + Time bT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds); DateTime bDate(bD,bT); aDate = bDate; } @@ -1068,8 +1068,8 @@ SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const template<class T> static double lcl_TimeToDouble( const T& rTime ) { - const double fMilliSecondsPerDay = 86400000.0; - return ((rTime.Hours*3600000)+(rTime.Minutes*60000)+(rTime.Seconds*1000)+(rTime.HundredthSeconds*10)) / fMilliSecondsPerDay; + const double fNanoSecondsPerDay = 86400000000000.0; + return ((rTime.Hours*3600000)+(rTime.Minutes*60000)+(rTime.Seconds*1000)+(rTime.NanoSeconds)) / fNanoSecondsPerDay; } template<class D> @@ -1904,7 +1904,7 @@ bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const case FIELD_PROP_DATE_TIME: { util::DateTime DateTimeValue; - DateTimeValue.HundredthSeconds = aDateTime.Get100Sec(); + DateTimeValue.NanoSeconds = aDateTime.GetNanoSec(); DateTimeValue.Seconds = aDateTime.GetSec(); DateTimeValue.Minutes = aDateTime.GetMin(); DateTimeValue.Hours = aDateTime.GetHour(); @@ -1957,7 +1957,7 @@ bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) util::DateTime aDateTimeValue; if(!(rAny >>= aDateTimeValue)) return sal_False; - aDateTime.Set100Sec(aDateTimeValue.HundredthSeconds); + aDateTime.SetNanoSec(aDateTimeValue.NanoSeconds); aDateTime.SetSec(aDateTimeValue.Seconds); aDateTime.SetMin(aDateTimeValue.Minutes); aDateTime.SetHour(aDateTimeValue.Hours); diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx index ddd92926b508..6f9076c6b6fa 100644 --- a/sw/source/core/fields/flddat.cxx +++ b/sw/source/core/fields/flddat.cxx @@ -194,7 +194,7 @@ bool SwDateTimeField::QueryValue( uno::Any& rVal, sal_uInt16 nWhichId ) const DateTime aDateTime(GetDate(), GetTime()); util::DateTime DateTimeValue; - DateTimeValue.HundredthSeconds = aDateTime.Get100Sec(); + DateTimeValue.NanoSeconds = aDateTime.GetNanoSec(); DateTimeValue.Seconds = aDateTime.GetSec(); DateTimeValue.Minutes = aDateTime.GetMin(); DateTimeValue.Hours = aDateTime.GetHour(); @@ -239,7 +239,7 @@ bool SwDateTimeField::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId ) if(!(rVal >>= aDateTimeValue)) return false; DateTime aDateTime( DateTime::EMPTY ); - aDateTime.Set100Sec(aDateTimeValue.HundredthSeconds); + aDateTime.SetNanoSec(aDateTimeValue.NanoSeconds); aDateTime.SetSec(aDateTimeValue.Seconds); aDateTime.SetMin(aDateTimeValue.Minutes); aDateTime.SetHour(aDateTimeValue.Hours); diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx index 98d076bac5e1..63e9027e9854 100644 --- a/sw/source/core/unocore/swunohelper.cxx +++ b/sw/source/core/unocore/swunohelper.cxx @@ -240,7 +240,7 @@ bool UCB_GetFileListOfFolder( const String& rURL, ::Time( aStamp.Hours, aStamp.Minutes, aStamp.Seconds, - aStamp.HundredthSeconds )); + aStamp.NanoSeconds )); pDateTimeList->push_back( pDateTime ); } } diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index d891e66c28fc..7870c3886200 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -204,7 +204,7 @@ static util::DateTime lcl_DateTimeToUno(const DateTime& rDT) aRetDT.Hours = rDT.GetHour(); aRetDT.Minutes = rDT.GetMin(); aRetDT.Seconds = rDT.GetSec(); - aRetDT.HundredthSeconds = rDT.Get100Sec(); + aRetDT.NanoSeconds = rDT.GetNanoSec(); return aRetDT; } diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index a62370fdb3af..de440b04ea30 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -284,15 +284,15 @@ static void WriteDop( WW8Export& rWrt ) { ::util::DateTime uDT = xDocProps->getCreationDate(); Date aD(uDT.Day, uDT.Month, uDT.Year); - Time aT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.HundredthSeconds); + Time aT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds); rDop.dttmCreated = sw::ms::DateTime2DTTM(DateTime(aD,aT)); uDT = xDocProps->getModificationDate(); Date aD2(uDT.Day, uDT.Month, uDT.Year); - Time aT2(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.HundredthSeconds); + Time aT2(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds); rDop.dttmRevised = sw::ms::DateTime2DTTM(DateTime(aD2,aT2)); uDT = xDocProps->getPrintDate(); Date aD3(uDT.Day, uDT.Month, uDT.Year); - Time aT3(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.HundredthSeconds); + Time aT3(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds); rDop.dttmLastPrint = sw::ms::DateTime2DTTM(DateTime(aD3,aT3)); } diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index cc00d10f45cc..627f5aa6448f 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1487,7 +1487,7 @@ void SwWW8ImplReader::ImportDop() { DateTime aLastPrinted( msfilter::util::DTTM2DateTime(pWDop->dttmLastPrint)); - ::util::DateTime uDT(aLastPrinted.Get100Sec(), + ::util::DateTime uDT(aLastPrinted.GetNanoSec(), aLastPrinted.GetSec(), aLastPrinted.GetMin(), aLastPrinted.GetHour(), aLastPrinted.GetDay(), aLastPrinted.GetMonth(), aLastPrinted.GetYear()); diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index b2abe8fa8642..00a59c7baa68 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -723,7 +723,7 @@ SwRedlineData* XMLRedlineImportHelper::ConvertRedline( aDT.SetHour( pRedlineInfo->aDateTime.Hours ); aDT.SetMin( pRedlineInfo->aDateTime.Minutes ); aDT.SetSec( pRedlineInfo->aDateTime.Seconds ); - aDT.Set100Sec( pRedlineInfo->aDateTime.HundredthSeconds ); + aDT.SetNanoSec( pRedlineInfo->aDateTime.NanoSeconds ); // 3) recursively convert next redline // ( check presence and sanity of hierarchical redline info ) |