diff options
114 files changed, 347 insertions, 227 deletions
diff --git a/automation/source/server/profiler.cxx b/automation/source/server/profiler.cxx index a7dc2eb3548a..52d0a8fd4c67 100644 --- a/automation/source/server/profiler.cxx +++ b/automation/source/server/profiler.cxx @@ -150,7 +150,7 @@ void TTProfiler::EndProfileInterval() void TTProfiler::GetProfileSnapshot( ProfileSnapshot *pProfileSnapshot ) { - pProfileSnapshot->aTime = Time(); + pProfileSnapshot->aTime = Time( Time::SYSTEM ); pProfileSnapshot->nProcessTicks = Time::GetProcessTicks(); pProfileSnapshot->nSystemTicks = Time::GetSystemTicks(); } diff --git a/automation/source/server/profiler.hxx b/automation/source/server/profiler.hxx index cf04699cd874..1aef4fbead63 100644 --- a/automation/source/server/profiler.hxx +++ b/automation/source/server/profiler.hxx @@ -50,6 +50,8 @@ struct ProfileSnapshot SysdepProfileSnapshot *pSysdepProfileSnapshot; sal_uLong nProcessTicks; sal_uLong nSystemTicks; + + ProfileSnapshot() : aTime( Time::EMPTY ) {} }; diff --git a/automation/source/server/sta_list.cxx b/automation/source/server/sta_list.cxx index 36031635c8cd..25799294b43c 100644 --- a/automation/source/server/sta_list.cxx +++ b/automation/source/server/sta_list.cxx @@ -990,7 +990,7 @@ sal_Bool StatementList::CheckWindowWait() { static Time StartTime = Time(0L); // cancel if window doesn't want to close at all if ( StartTime == Time(0L) ) - StartTime = Time(); + StartTime = Time( Time::SYSTEM ); if ( pWindowWaitPointer ) { @@ -1005,7 +1005,7 @@ sal_Bool StatementList::CheckWindowWait() #endif - if ( StartTime + Time(0,0,10) < Time() ) + if ( StartTime + Time(0,0,10) < Time( Time::SYSTEM ) ) { #if OSL_DEBUG_LEVEL > 1 m_pDbgWin->AddText( "Close timed out. Going on!! " ); diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index 15c2c5357d1a..8eb6ba368fb1 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -1202,6 +1202,7 @@ DisplayHidWin::DisplayHidWin() , pShow2( NULL ) , pLastMouseMoveWin( NULL ) , bOldShift( 0 ) +, aLatest( Time::SYSTEM ) , nShiftCount( 0 ) { SetOutStyle( TOOLBOX_STYLE_HANDPOINTER | TOOLBOX_STYLE_FLAT ); @@ -1332,17 +1333,17 @@ long DisplayHidWin::VCLEventHook( NotifyEvent& rEvt ) if ( ( pMEvt->IsShift() && !bOldShift ) ) // Shift pressed { - if ( aLatest < Time() ) + if ( aLatest < Time( Time::SYSTEM ) ) { nShiftCount = 0; - aLatest = Time()+Time( 0, 0, 0, 50 ); + aLatest = Time( Time::SYSTEM )+Time( 0, 0, 0, 50 ); } nShiftCount++; } if ( ( !pMEvt->IsShift() && bOldShift ) ) // Shift released { nShiftCount++; - if ( nShiftCount == 4 && aLatest > Time() ) + if ( nShiftCount == 4 && aLatest > Time( Time::SYSTEM ) ) { bIsPermanentDraging = sal_False; SetDraging( sal_False ); @@ -2246,10 +2247,10 @@ sal_Bool StatementCommand::Execute() case RC_AppDelay: if ( !bBool1 ) { - nLNr1_and_Pointer.nLNr1 = Time().GetTime() + nNr1/10; + nLNr1_and_Pointer.nLNr1 = Time( Time::SYSTEM ).GetTime() + nNr1/10; bBool1 = sal_True; } - if ( Time().GetTime() < sal_Int32(nLNr1_and_Pointer.nLNr1) ) + if ( Time( Time::SYSTEM ).GetTime() < sal_Int32(nLNr1_and_Pointer.nLNr1) ) return sal_False; break; case RC_DisplayHid: @@ -2455,10 +2456,10 @@ sal_Bool StatementCommand::Execute() // E.g.: Floating toolbars on a Task which was hidden by another Task before if ( !bBool2 ) { - nLNr1_and_Pointer.nLNr1 = Time().GetTime() + 100; // 100 = 1 Second + nLNr1_and_Pointer.nLNr1 = Time( Time::SYSTEM ).GetTime() + 100; // 100 = 1 Second bBool2 = sal_True; } - if ( Time().GetTime() < sal_Int32(nLNr1_and_Pointer.nLNr1) ) + if ( Time( Time::SYSTEM ).GetTime() < sal_Int32(nLNr1_and_Pointer.nLNr1) ) return sal_False; else pRet->GenReturn ( RET_Value, nMethodId, aString1); @@ -2470,7 +2471,7 @@ sal_Bool StatementCommand::Execute() nNr1 = 1000; // defaults to 1000 = 1 Sec. if ( !bBool1 ) { - nLNr1_and_Pointer.nLNr1 = Time().GetTime() + nNr1/10; + nLNr1_and_Pointer.nLNr1 = Time( Time::SYSTEM ).GetTime() + nNr1/10; bBool1 = sal_True; } @@ -2478,7 +2479,7 @@ sal_Bool StatementCommand::Execute() pRet->GenReturn ( RET_Value, nMethodId, comm_UINT16(CONST_WSFinished) ); else { - if ( Time().GetTime() < sal_Int32(nLNr1_and_Pointer.nLNr1) ) + if ( Time( Time::SYSTEM ).GetTime() < sal_Int32(nLNr1_and_Pointer.nLNr1) ) return sal_False; pRet->GenReturn ( RET_Value, nMethodId, comm_UINT16(CONST_WSTimeout) ); } @@ -4051,7 +4052,7 @@ sal_Bool StatementControl::HandleCommonMethods( Window *pControl ) pDlg->SetText(UniString("Schlie�en", RTL_TEXTENCODING_ISO_8859_1)); pDlg->Show(); pMyEd->Show(); - sal_uLong nTime = Time().GetTime(); + sal_uLong nTime = Time( Time::SYSTEM ).GetTime(); while (pDlg->IsVisible()) { @@ -4060,9 +4061,10 @@ sal_Bool StatementControl::HandleCommonMethods( Window *pControl ) SafeReschedule(); Point Pos = pControl->GetPointerPosPixel(); Size Siz=pControl->GetOutputSizePixel(); - if ( Time().GetTime() - nTime > 10 ) + Time aSysTime( Time::SYSTEM ); + if ( aSysTime.GetTime() - nTime > 10 ) { - nTime = Time().GetTime(); + nTime = aSysTime.GetTime(); pMyEd->SetText(UniString::CreateFromInt32(Pos.X()*100/Siz.Width()).AppendAscii("%x").Append( UniString::CreateFromInt32(Pos.Y()*100/Siz.Height()) ).Append('%')); } } @@ -4391,7 +4393,7 @@ sal_Bool StatementControl::Execute() { case M_Exists: case M_NotExists: - Time aT; + Time aT( Time::SYSTEM ); sal_uInt16 aSeconds = aT.GetMin()*60+aT.GetSec(); if ( !bBool2 ) // has been set to sal_False in the constructor { @@ -5148,8 +5150,8 @@ sal_Bool StatementControl::Execute() // Wait for the window to open. StatementList::bExecuting = sal_True; { - Time aDelay; - while ( !pWin && ( (pWin = GetPopupFloatingWin()) == NULL ) && ( Time() - aDelay ).GetSec() < 15 ) + Time aDelay( Time::SYSTEM ); + while ( !pWin && ( (pWin = GetPopupFloatingWin()) == NULL ) && ( Time( Time::SYSTEM ) - aDelay ).GetSec() < 15 ) SafeReschedule(); } StatementList::bExecuting = sal_False; diff --git a/automation/source/simplecm/simplecm.cxx b/automation/source/simplecm/simplecm.cxx index bd1e83a69554..b0d9ee20559a 100644 --- a/automation/source/simplecm/simplecm.cxx +++ b/automation/source/simplecm/simplecm.cxx @@ -53,7 +53,9 @@ CommunicationLink::CommunicationLink( CommunicationManager *pMan ) , pServiceData(NULL) , nServiceProtocol( 0 ) , bIsInsideCallback( sal_False ) +, aStart( DateTime::EMPTY ) , nTotalBytes( 0 ) +, aLastAccess( DateTime::EMPTY ) , maApplication("Undefined") #if OSL_DEBUG_LEVEL > 1 , bFlag( sal_False ) @@ -123,7 +125,7 @@ sal_Bool CommunicationLink::DoTransferDataStream( SvStream *pDataStream, CMProto sal_Bool CommunicationLink::TransferDataStream( SvStream *pDataStream, CMProtocol nProtocol ) { - aLastAccess = DateTime(); + aLastAccess = DateTime( DateTime::SYSTEM ); nTotalBytes += pDataStream->Seek( STREAM_SEEK_TO_END ); return DoTransferDataStream( pDataStream, nProtocol ); } @@ -375,7 +377,7 @@ ByteString CommunicationManager::GetMyName( CM_NameType ) void CommunicationManager::CallConnectionOpened( CommunicationLink* pCL ) { pCL->StartCallback(); // This should already have been called. - pCL->aStart = DateTime(); + pCL->aStart = DateTime( DateTime::SYSTEM ); pCL->aLastAccess = pCL->aStart; bIsCommunicationRunning = sal_True; pCL->SetApplication( GetApplication() ); @@ -392,7 +394,7 @@ void CommunicationManager::CallConnectionOpened( CommunicationLink* pCL ) void CommunicationManager::CallConnectionClosed( CommunicationLink* pCL ) { pCL->StartCallback(); // This should already have been called. - pCL->aLastAccess = DateTime(); + pCL->aLastAccess = DateTime( DateTime::SYSTEM ); INFO_MSG( CByteString("C-:").Append( pCL->GetCommunicationPartner( CM_FQDN ) ), CByteString("Connection broken: ").Append( pCL->GetCommunicationPartner( CM_FQDN ) ), @@ -409,7 +411,7 @@ void CommunicationManager::CallConnectionClosed( CommunicationLink* pCL ) void CommunicationManager::CallDataReceived( CommunicationLink* pCL ) { pCL->StartCallback(); // Should have already been called - pCL->aLastAccess = DateTime(); + pCL->aLastAccess = DateTime( DateTime::SYSTEM ); CommunicationLinkRef rHold(pCL); // Keep the pointer for a bit. // should be impossible but happens for mysterious reasons diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx index af677dc5e43f..ff8745d6ab71 100644 --- a/automation/source/testtool/objtest.cxx +++ b/automation/source/testtool/objtest.cxx @@ -1063,12 +1063,12 @@ void TestToolObj::WaitForAnswer () } else { - Time Ende; + Time Ende( Time::SYSTEM ); Ende += pImpl->aServerTimeout; SvStream *pTemp = NULL; - while ( !bReturnOK && Ende > Time() ) + while ( !bReturnOK && Ende > Time( Time::SYSTEM ) ) { if ( pTemp ) { diff --git a/automation/source/testtool/objtest.hxx b/automation/source/testtool/objtest.hxx index afcb6b963b6d..3c7ab881b4ad 100644 --- a/automation/source/testtool/objtest.hxx +++ b/automation/source/testtool/objtest.hxx @@ -291,6 +291,8 @@ public: Environment *pChildEnv; // Environment Variables for child Process HttpRequest *pHttpRequest; // used for sending HTTP requests + + ImplTestToolObj() : aServerTimeout( Time::EMPTY ) {} }; diff --git a/automation/source/testtool/tcommuni.cxx b/automation/source/testtool/tcommuni.cxx index 2e0d7b8539ff..44dc5f2fec18 100644 --- a/automation/source/testtool/tcommuni.cxx +++ b/automation/source/testtool/tcommuni.cxx @@ -42,6 +42,7 @@ CommunicationManagerClientViaSocketTT::CommunicationManagerClientViaSocketTT() : CommunicationManagerClientViaSocket( sal_True ) +, aFirstRetryCall( Time::EMPTY ) , aAppPath() , aAppParams() , pProcess( NULL ) @@ -82,7 +83,7 @@ sal_Bool CommunicationManagerClientViaSocketTT::RetryConnect() if ( bSucc ) { - aFirstRetryCall = Time() + Time( 0, 1 ); + aFirstRetryCall = Time( Time::SYSTEM ) + Time( 0, 1 ); for ( int i = 10 ; i-- ; ) GetpApp()->Reschedule(); } @@ -92,7 +93,7 @@ sal_Bool CommunicationManagerClientViaSocketTT::RetryConnect() } else { - if ( aFirstRetryCall > Time() ) + if ( aFirstRetryCall > Time( Time::SYSTEM ) ) { Timer aWait; aWait.SetTimeout( 500 ); diff --git a/basic/source/app/msgedit.cxx b/basic/source/app/msgedit.cxx index 06e68bf7fa45..cda2c4fa3e6f 100644 --- a/basic/source/app/msgedit.cxx +++ b/basic/source/app/msgedit.cxx @@ -136,8 +136,8 @@ void MsgEdit::AddAnyMsg( TTLogMsg *LogMsg ) { SvtSysLocale aLocale; LogMsg->aDebugData.aMsg = GEN_RES_STR2( S_PROG_START, - aLocale.GetLocaleData().getDate(Date()), - aLocale.GetLocaleData().getTime(Time()) ); + aLocale.GetLocaleData().getDate(Date( Date::SYSTEM)), + aLocale.GetLocaleData().getTime(Time( Time::SYSTEM)) ); aUILogMsg = pBasicFrame->GenRealString( LogMsg->aDebugData.aMsg ); } AddRun( aUILogMsg, LogMsg->aDebugData ); break; diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 251454b2583b..e3d5d48cde5d 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2151,8 +2151,8 @@ RTLFUNC(Second) double Now_Impl() { - Date aDate; - Time aTime; + Date aDate( Date::SYSTEM ); + Time aTime( Time::SYSTEM ); double aSerial = (double)GetDayDiff( aDate ); long nSeconds = aTime.GetHour(); nSeconds *= 3600; @@ -2180,7 +2180,7 @@ RTLFUNC(Time) if ( !bWrite ) { - Time aTime; + Time aTime( Time::SYSTEM ); SbxVariable* pMeth = rPar.Get( 0 ); String aRes; if( pMeth->IsFixed() ) @@ -2232,7 +2232,7 @@ RTLFUNC(Timer) (void)pBasic; (void)bWrite; - Time aTime; + Time aTime( Time::SYSTEM ); long nSeconds = aTime.GetHour(); nSeconds *= 3600; nSeconds += aTime.GetMin() * 60; @@ -2248,7 +2248,7 @@ RTLFUNC(Date) if ( !bWrite ) { - Date aToday; + Date aToday( Date::SYSTEM ); double nDays = (double)GetDayDiff( aToday ); SbxVariable* pMeth = rPar.Get( 0 ); if( pMeth->IsString() ) @@ -2922,8 +2922,8 @@ RTLFUNC(FileDateTime) else { String aPath = rPar.Get(1)->GetString(); - Time aTime; - Date aDate; + Time aTime( Time::EMPTY ); + Date aDate( Date::EMPTY ); if( hasUno() ) { com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess(); diff --git a/chart2/source/view/axes/DateScaling.cxx b/chart2/source/view/axes/DateScaling.cxx index 57850921c244..cb532ab79f5f 100644 --- a/chart2/source/view/axes/DateScaling.cxx +++ b/chart2/source/view/axes/DateScaling.cxx @@ -168,7 +168,7 @@ double SAL_CALL InverseDateScaling::doScaling( double value ) else value -= 0.5; } - Date aDate; + Date aDate( Date::EMPTY ); double fYear = ::rtl::math::approxFloor(value/lcl_fNumberOfMonths); double fMonth = ::rtl::math::approxFloor(value-(fYear*lcl_fNumberOfMonths)); if( fMonth==0.0 ) diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 04c42cd67f64..78a50e2f50bc 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -464,7 +464,7 @@ private: }; AxisUsage::AxisUsage() - : aScaleAutomatism(AxisHelper::createDefaultScale(),Date()) + : aScaleAutomatism(AxisHelper::createDefaultScale(),Date( Date::SYSTEM )) { } diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx index 317b454b1172..3448d49648b0 100644 --- a/connectivity/source/drivers/calc/CTable.cxx +++ b/connectivity/source/drivers/calc/CTable.cxx @@ -551,6 +551,7 @@ OCalcTable::OCalcTable(sdbcx::OCollection* _pTables,OCalcConnection* _pConnectio ,m_nDataCols(0) ,m_nDataRows(0) ,m_bHasHeaders(sal_False) + ,m_aNullDate(::Date::EMPTY) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::OCalcTable" ); } diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index cb1b2eb1eaef..8d6c4670a6a6 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -1158,7 +1158,7 @@ sal_Bool ODbaseTable::CreateFile(const INetURLObject& aFile, sal_Bool& bCreateMe { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::CreateFile" ); bCreateMemo = sal_False; - Date aDate; // current date + Date aDate( Date::SYSTEM ); // current date m_pFileStream = createStream_simpleError( aFile.GetMainURL(INetURLObject::NO_DECODE),STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC ); diff --git a/connectivity/source/drivers/file/FDateFunctions.cxx b/connectivity/source/drivers/file/FDateFunctions.cxx index e8185d866881..8bffd17ea90e 100644 --- a/connectivity/source/drivers/file/FDateFunctions.cxx +++ b/connectivity/source/drivers/file/FDateFunctions.cxx @@ -263,7 +263,7 @@ ORowSetValue OOp_CurDate::operate(const ::std::vector<ORowSetValue>& lhs) const if ( !lhs.empty() ) return ORowSetValue(); - Date aCurDate; + Date aCurDate( Date::SYSTEM ); return ::com::sun::star::util::Date(aCurDate.GetDay(),aCurDate.GetMonth(),aCurDate.GetYear()); } //------------------------------------------------------------------ @@ -272,7 +272,7 @@ ORowSetValue OOp_CurTime::operate(const ::std::vector<ORowSetValue>& lhs) const if ( !lhs.empty() ) return ORowSetValue(); - Time aCurTime; + Time aCurTime( Time::SYSTEM ); return ::com::sun::star::util::Time(aCurTime.Get100Sec(),aCurTime.GetSec(),aCurTime.GetMin(),aCurTime.GetHour()); } //------------------------------------------------------------------ @@ -281,7 +281,7 @@ ORowSetValue OOp_Now::operate(const ::std::vector<ORowSetValue>& lhs) const if ( !lhs.empty() ) return ORowSetValue(); - DateTime aCurTime; + DateTime aCurTime( DateTime::SYSTEM ); return ::com::sun::star::util::DateTime(aCurTime.Get100Sec(),aCurTime.GetSec(),aCurTime.GetMin(),aCurTime.GetHour(), aCurTime.GetDay(),aCurTime.GetMonth(),aCurTime.GetYear()); } diff --git a/cui/source/dialogs/postdlg.cxx b/cui/source/dialogs/postdlg.cxx index e16815ce84ef..ab5ed760d79f 100644 --- a/cui/source/dialogs/postdlg.cxx +++ b/cui/source/dialogs/postdlg.cxx @@ -135,7 +135,7 @@ SvxPostItDialog::SvxPostItDialog( Window* pParent, else { LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); - aDateStr = aLocaleWrapper.getDate( Date() ); + aDateStr = aLocaleWrapper.getDate( Date( Date::SYSTEM ) ); } nWhich = rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_TEXT ); @@ -218,8 +218,8 @@ IMPL_LINK_INLINE_END( SvxPostItDialog, NextHdl, Button *, EMPTYARG ) IMPL_LINK( SvxPostItDialog, Stamp, Button *, EMPTYARG ) { - Date aDate; - Time aTime; + Date aDate( Date::SYSTEM ); + Time aTime( Time::SYSTEM ); String aTmp( SvtUserOptions().GetID() ); LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); String aStr( aEditED.GetText() ); @@ -251,7 +251,7 @@ IMPL_LINK( SvxPostItDialog, OKHdl, Button *, EMPTYARG ) pOutSet = new SfxItemSet( rSet ); pOutSet->Put( SvxPostItAuthorItem( SvtUserOptions().GetID(), rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_AUTHOR ) ) ); - pOutSet->Put( SvxPostItDateItem( aLocaleWrapper.getDate( Date() ), + pOutSet->Put( SvxPostItDateItem( aLocaleWrapper.getDate( Date( Date::SYSTEM ) ), rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_DATE ) ) ); pOutSet->Put( SvxPostItTextItem( aEditED.GetText(), rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_TEXT ) ) ); diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx index ee87645b3bcd..7e7beceaa88f 100644 --- a/cui/source/options/optupdt.cxx +++ b/cui/source/options/optupdt.cxx @@ -133,8 +133,8 @@ void SvxOnlineUpdateTabPage::UpdateLastCheckedText() TimeValue lastCheckedTV; oslDateTime lastCheckedDT; - Date aDate; - Time aTime; + Date aDate( Date::EMPTY ); + Time aTime( Time::EMPTY ); lastCheckedTV.Seconds = (sal_uInt32) lastChecked; osl_getLocalTimeFromSystemTime( &lastCheckedTV, &lastCheckedTV ); diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index eb8b8f5e2205..56b2d71f68fa 100644 --- a/editeng/source/items/flditem.cxx +++ b/editeng/source/items/flditem.cxx @@ -202,7 +202,7 @@ SV_IMPL_PERSIST1( SvxDateField, SvxFieldData ); SvxDateField::SvxDateField() { - nFixDate = Date().GetDate(); + nFixDate = Date( Date::SYSTEM ).GetDate(); eType = SVXDATETYPE_VAR; eFormat = SVXDATEFORMAT_STDSMALL; } @@ -263,9 +263,11 @@ void SvxDateField::Save( SvPersistStream & rStm ) String SvxDateField::GetFormatted( SvNumberFormatter& rFormatter, LanguageType eLang ) const { - Date aDate; // current date + Date aDate( Date::EMPTY ); if ( eType == SVXDATETYPE_FIX ) aDate.SetDate( nFixDate ); + else + aDate = Date( Date::SYSTEM ); // current date return GetFormatted( aDate, eFormat, rFormatter, eLang ); } @@ -551,7 +553,7 @@ SV_IMPL_PERSIST1( SvxExtTimeField, SvxFieldData ); SvxExtTimeField::SvxExtTimeField() { - nFixTime = Time().GetTime(); + nFixTime = Time( Time::SYSTEM ).GetTime(); eType = SVXTIMETYPE_VAR; eFormat = SVXTIMEFORMAT_STANDARD; } @@ -612,9 +614,11 @@ void SvxExtTimeField::Save( SvPersistStream & rStm ) String SvxExtTimeField::GetFormatted( SvNumberFormatter& rFormatter, LanguageType eLang ) const { - Time aTime; // current time + Time aTime( Time::EMPTY ); if ( eType == SVXTIMETYPE_FIX ) aTime.SetTime( nFixTime ); + else + aTime = Time( Time::SYSTEM ); // current time return GetFormatted( aTime, eFormat, rFormatter, eLang ); } diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 1040ba8ed947..f044d6aca16c 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -1645,7 +1645,7 @@ sal_Bool SvxAutoCorrect::CreateLanguageFile( LanguageType eLang, sal_Bool bNewFi sShareDirFile( sUserDirFile ); SvxAutoCorrectLanguageListsPtr pLists = 0; - Time nMinTime( 0, 2 ), nAktTime, nLastCheckTime; + Time nMinTime( 0, 2 ), nAktTime( Time::SYSTEM ), nLastCheckTime( Time::EMPTY ); sal_uLong nFndPos; if( TABLE_ENTRY_NOTFOUND != pLastFileTable->SearchKey( sal_uLong( eLang ), &nFndPos ) && @@ -1986,6 +1986,9 @@ SvxAutoCorrectLanguageLists::SvxAutoCorrectLanguageLists( LanguageType eLang) : sShareAutoCorrFile( rShareAutoCorrectFile ), sUserAutoCorrFile( rUserAutoCorrectFile ), + aModifiedDate( Date::EMPTY ), + aModifiedTime( Time::EMPTY ), + aLastCheckTime( Time::EMPTY ), eLanguage(eLang), pCplStt_ExcptLst( 0 ), pWrdStt_ExcptLst( 0 ), @@ -2008,11 +2011,11 @@ sal_Bool SvxAutoCorrectLanguageLists::IsFileChanged_Imp() sal_Bool bRet = sal_False; Time nMinTime( 0, 2 ); - Time nAktTime; + Time nAktTime( Time::SYSTEM ); if( aLastCheckTime > nAktTime || // overflow? ( nAktTime -= aLastCheckTime ) > nMinTime ) // min time past { - Date aTstDate; Time aTstTime; + Date aTstDate( Date::EMPTY ); Time aTstTime( Time::EMPTY ); if( FStatHelper::GetModifiedDateTimeOfFile( sShareAutoCorrFile, &aTstDate, &aTstTime ) && ( aModifiedDate != aTstDate || aModifiedTime != aTstTime )) @@ -2027,7 +2030,7 @@ sal_Bool SvxAutoCorrectLanguageLists::IsFileChanged_Imp() delete pAutocorr_List, pAutocorr_List = 0; nFlags &= ~(CplSttLstLoad | WrdSttLstLoad | ChgWordLstLoad ); } - aLastCheckTime = Time(); + aLastCheckTime = Time( Time::SYSTEM ); } return bRet; } @@ -2114,7 +2117,7 @@ void SvxAutoCorrectLanguageLists::LoadXMLExceptList_Imp( // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sShareAutoCorrFile, &aModifiedDate, &aModifiedTime ); - aLastCheckTime = Time(); + aLastCheckTime = Time( Time::SYSTEM ); } } @@ -2230,7 +2233,7 @@ SvxAutocorrWordList* SvxAutoCorrectLanguageLists::LoadAutocorrWordList() // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sShareAutoCorrFile, &aModifiedDate, &aModifiedTime ); - aLastCheckTime = Time(); + aLastCheckTime = Time( Time::SYSTEM ); return pAutocorr_List; } @@ -2276,7 +2279,7 @@ sal_Bool SvxAutoCorrectLanguageLists::AddToCplSttExceptList(const String& rNew) // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile, &aModifiedDate, &aModifiedTime ); - aLastCheckTime = Time(); + aLastCheckTime = Time( Time::SYSTEM ); } else delete pNew, pNew = 0; @@ -2298,7 +2301,7 @@ sal_Bool SvxAutoCorrectLanguageLists::AddToWrdSttExceptList(const String& rNew) // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile, &aModifiedDate, &aModifiedTime ); - aLastCheckTime = Time(); + aLastCheckTime = Time( Time::SYSTEM ); } else delete pNew, pNew = 0; @@ -2327,7 +2330,7 @@ void SvxAutoCorrectLanguageLists::SaveCplSttExceptList() // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile, &aModifiedDate, &aModifiedTime ); - aLastCheckTime = Time(); + aLastCheckTime = Time( Time::SYSTEM ); } void SvxAutoCorrectLanguageLists::SetCplSttExceptList( SvStringsISortDtor* pList ) @@ -2364,7 +2367,7 @@ void SvxAutoCorrectLanguageLists::SaveWrdSttExceptList() // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile, &aModifiedDate, &aModifiedTime ); - aLastCheckTime = Time(); + aLastCheckTime = Time( Time::SYSTEM ); } void SvxAutoCorrectLanguageLists::SetWrdSttExceptList( SvStringsISortDtor* pList ) diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index 80b3aa6c2463..1f3cee796ac6 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -339,7 +339,7 @@ SvxUnoTextField::SvxUnoTextField( uno::Reference< text::XTextRange > xAnchor, co sal_Bool bFixed = ((SvxDateField*)pData)->GetType() == SVXDATETYPE_FIX; mpImpl->maDateTime = getDate( bFixed ? ((SvxDateField*)pData)->GetFixDate() : - Date().GetDate() ); + Date( Date::SYSTEM ).GetDate() ); mpImpl->mnInt32 = ((SvxDateField*)pData)->GetFormat(); mpImpl->mbBoolean1 = bFixed; } diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index bb8e8b2e7567..2b740acc204c 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -294,7 +294,7 @@ namespace pcr util::DateTime aUNODateTime; OSL_VERIFY( _rValue >>= aUNODateTime ); - ::DateTime aDateTime; + ::DateTime aDateTime( ::DateTime::EMPTY ); ::utl::typeConvert( aUNODateTime, aDateTime ); double nValue = aDateTime - ::DateTime( *getTypedControlWindow()->GetFormatter()->GetNullDate() ); diff --git a/extensions/source/propctrlr/usercontrol.cxx b/extensions/source/propctrlr/usercontrol.cxx index d039887ae4fd..84108c64e4e6 100644 --- a/extensions/source/propctrlr/usercontrol.cxx +++ b/extensions/source/propctrlr/usercontrol.cxx @@ -134,7 +134,7 @@ namespace pcr { case NUMBERFORMAT_DATE: { - Date aCurrentDate; + Date aCurrentDate( Date::SYSTEM ); static ::com::sun::star::util::Date STANDARD_DB_DATE(30,12,1899); nValue = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDate(static_cast<sal_Int32>(aCurrentDate.GetDate())),STANDARD_DB_DATE); } @@ -142,7 +142,7 @@ namespace pcr case NUMBERFORMAT_TIME: case NUMBERFORMAT_DATETIME: { - Time aCurrentTime; + Time aCurrentTime( Time::SYSTEM ); nValue = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toTime(aCurrentTime.GetTime())); } break; diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 430ced0402c2..0cd57668c263 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -6285,10 +6285,10 @@ void PPTFieldEntry::SetDateTime( sal_uInt32 nVal ) SvxTimeFormat eTimeFormat; GetDateTime( nVal, eDateFormat, eTimeFormat ); if ( eDateFormat != SVXDATEFORMAT_APPDEFAULT ) - pField1 = new SvxFieldItem( SvxDateField( Date(), SVXDATETYPE_VAR, eDateFormat ), EE_FEATURE_FIELD ); + pField1 = new SvxFieldItem( SvxDateField( Date( Date::SYSTEM ), SVXDATETYPE_VAR, eDateFormat ), EE_FEATURE_FIELD ); if ( eTimeFormat != SVXTIMEFORMAT_APPDEFAULT ) { - SvxFieldItem* pFieldItem = new SvxFieldItem( SvxExtTimeField( Time(), SVXTIMETYPE_VAR, eTimeFormat ), EE_FEATURE_FIELD ); + SvxFieldItem* pFieldItem = new SvxFieldItem( SvxExtTimeField( Time( Time::SYSTEM ), SVXTIMETYPE_VAR, eTimeFormat ), EE_FEATURE_FIELD ); if ( pField1 ) pField2 = pFieldItem; else @@ -6680,7 +6680,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport if ( pEntry->pString == NULL ) { // Handle as previously - pEntry->pField1 = new SvxFieldItem( SvxDateField( Date(), SVXDATETYPE_FIX ), EE_FEATURE_FIELD ); + pEntry->pField1 = new SvxFieldItem( SvxDateField( Date( Date::SYSTEM ), SVXDATETYPE_FIX ), EE_FEATURE_FIELD ); } } } diff --git a/filter/source/xsltdialog/xmlfileview.cxx b/filter/source/xsltdialog/xmlfileview.cxx index 90f46999bdd6..206af57dd49f 100644 --- a/filter/source/xsltdialog/xmlfileview.cxx +++ b/filter/source/xsltdialog/xmlfileview.cxx @@ -866,7 +866,7 @@ void XMLFileWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff ) IMPL_LINK( XMLFileWindow, SyntaxTimerHdl, Timer *, pTimer ) { - Time aSyntaxCheckStart; + Time aSyntaxCheckStart( Time::SYSTEM ); DBG_ASSERT( pTextView, "Noch keine View, aber Syntax-Highlight ?!" ); pTextEngine->SetUpdateMode( sal_False ); @@ -891,7 +891,7 @@ IMPL_LINK( XMLFileWindow, SyntaxTimerHdl, Timer *, pTimer ) nCount++; if(!aSyntaxLineTable.Count()) break; - if((Time().GetTime() - aSyntaxCheckStart.GetTime()) > MAX_HIGHLIGHTTIME ) + if((Time( Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime()) > MAX_HIGHLIGHTTIME ) { pTimer->SetTimeout( 2 * SYNTAX_HIGHLIGHT_TIMEOUT ); break; @@ -909,7 +909,7 @@ IMPL_LINK( XMLFileWindow, SyntaxTimerHdl, Timer *, pTimer ) p = aSyntaxLineTable.Next(); aSyntaxLineTable.Remove(nC); nCount ++; - if(Time().GetTime() - aSyntaxCheckStart.GetTime() > MAX_HIGHLIGHTTIME) + if(Time( Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime() > MAX_HIGHLIGHTTIME) { pTimer->SetTimeout( 2 * SYNTAX_HIGHLIGHT_TIMEOUT ); break; diff --git a/forms/source/xforms/xpathlib/xpathlib.cxx b/forms/source/xforms/xpathlib/xpathlib.cxx index 45bde1166461..5168fd7cd705 100644 --- a/forms/source/xforms/xpathlib/xpathlib.cxx +++ b/forms/source/xforms/xpathlib/xpathlib.cxx @@ -287,7 +287,7 @@ void xforms_nowFunction(xmlXPathParserContextPtr ctxt, int /*nargs*/) be omitted or, if present, the time zone must be Coordinated Universal Time (UTC) indicated by a "Z". */ - DateTime aDateTime; + DateTime aDateTime( DateTime::SYSTEM ); ::rtl::OString aDateTimeString = makeDateTimeString(aDateTime); xmlChar *pString = static_cast<xmlChar*>(xmlMalloc(aDateTimeString.getLength()+1)); strncpy((char*)pString, (char*)aDateTimeString.getStr(), aDateTimeString.getLength()); @@ -347,7 +347,7 @@ void xforms_daysFromDateFunction(xmlXPathParserContextPtr ctxt, int nargs) if (xmlXPathCheckError(ctxt)) XP_ERROR(XPATH_INVALID_TYPE); ::rtl::OUString aString((char*)pString, strlen((char*)pString), RTL_TEXTENCODING_UTF8); - DateTime aDateTime; + DateTime aDateTime( DateTime::EMPTY ); if (parseDateTime(aString, aDateTime)) { Date aReferenceDate(1, 1, 1970); @@ -370,7 +370,7 @@ void xforms_secondsFromDateTimeFunction(xmlXPathParserContextPtr ctxt, int nargs if (xmlXPathCheckError(ctxt)) XP_ERROR(XPATH_INVALID_TYPE); ::rtl::OUString aString((char*)pString, strlen((char*)pString), RTL_TEXTENCODING_UTF8); - DateTime aDateTime; + DateTime aDateTime( DateTime::EMPTY ); if (parseDateTime(aString, aDateTime)) { diff --git a/framework/source/jobs/jobdata.cxx b/framework/source/jobs/jobdata.cxx index 8469dbab6b7f..f65c3d996bfc 100644 --- a/framework/source/jobs/jobdata.cxx +++ b/framework/source/jobs/jobdata.cxx @@ -562,7 +562,7 @@ void JobData::disableJob() { // Convert and write the user timestamp to the configuration. css::uno::Any aValue; - aValue <<= Converter::convert_DateTime2ISO8601(DateTime()); + aValue <<= Converter::convert_DateTime2ISO8601(DateTime( DateTime::SYSTEM)); xPropSet->setPropertyValue(::rtl::OUString::createFromAscii(EVENTCFG_PROP_USERTIME), aValue); } diff --git a/framework/source/services/license.cxx b/framework/source/services/license.cxx index 221cd5959061..73d1e6dfca4c 100644 --- a/framework/source/services/license.cxx +++ b/framework/source/services/license.cxx @@ -239,7 +239,7 @@ static sal_Bool _parseDateTime(const ::rtl::OUString& aString, DateTime& aDateTi static ::rtl::OUString _getCurrentDateString() { ::rtl::OUString aString; - return _makeDateTimeString(DateTime()); + return _makeDateTimeString(DateTime( DateTime::SYSTEM)); } // execution of license check... @@ -328,7 +328,7 @@ css::uno::Any SAL_CALL License::execute(const css::uno::Sequence< css::beans::Na // compare dates DateTime aLicenseDateTime = _oslDateTimeToDateTime(aDateTimeVal); - DateTime aAcceptDateTime; + DateTime aAcceptDateTime( DateTime::EMPTY); if (!_parseDateTime(aAcceptDate, aAcceptDateTime)) return makeAny(sal_False); diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx index 2acbede53c4a..fec515f2b888 100644 --- a/l10ntools/source/export2.cxx +++ b/l10ntools/source/export2.cxx @@ -382,9 +382,9 @@ ByteString Export::GetTimeStamp() { // return "xx.xx.xx"; char buf[20]; - Time aTime; + Time aTime( Time::SYSTEM ); - snprintf(buf, sizeof(buf), "%8d %02d:%02d:%02d", int(Date().GetDate()), + snprintf(buf, sizeof(buf), "%8d %02d:%02d:%02d", int(Date( Date::SYSTEM).GetDate()), int(aTime.GetHour()), int(aTime.GetMin()), int(aTime.GetSec())); return ByteString(buf); } diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx index a3a46bef5723..51e996e005ea 100644 --- a/padmin/source/padialog.cxx +++ b/padmin/source/padialog.cxx @@ -491,9 +491,9 @@ void SpaPrinterController::printPage( int ) const aPrintText.appendAscii( "\n: " ); aPrintText.append( aInfo.m_aComment ); aPrintText.appendAscii( "\n: " ); - aPrintText.append( rLocaleWrapper.getDate( Date() ) ); + aPrintText.append( rLocaleWrapper.getDate( Date( Date::SYSTEM ) ) ); aPrintText.appendAscii( "\n: " ); - aPrintText.append( rLocaleWrapper.getTime( Time() ) ); + aPrintText.append( rLocaleWrapper.getTime( Time( Time::SYSTEM ) ) ); pPrinter->DrawText( Rectangle( Point( 1100 + nMaxWidth, 1000 ), Size( aPaperSize.Width() - 2100 - nMaxWidth, diff --git a/reportdesign/source/ui/dlg/DateTime.cxx b/reportdesign/source/ui/dlg/DateTime.cxx index 4edb039913d2..563d24f356ef 100644 --- a/reportdesign/source/ui/dlg/DateTime.cxx +++ b/reportdesign/source/ui/dlg/DateTime.cxx @@ -198,12 +198,12 @@ short ODateTimeDialog::Execute() double nValue = 0; if ( _bTime ) { - Time aCurrentTime; + Time aCurrentTime( Time::SYSTEM ); nValue = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toTime(aCurrentTime.GetTime())); } else { - Date aCurrentDate; + Date aCurrentDate( Date::SYSTEM ); static ::com::sun::star::util::Date STANDARD_DB_DATE(30,12,1899); nValue = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDate(static_cast<sal_Int32>(aCurrentDate.GetDate())),STANDARD_DB_DATE); } diff --git a/sc/inc/chgviset.hxx b/sc/inc/chgviset.hxx index 630128a8be94..6d95abc9f1cf 100644 --- a/sc/inc/chgviset.hxx +++ b/sc/inc/chgviset.hxx @@ -68,7 +68,9 @@ private: public: - ScChangeViewSettings() + ScChangeViewSettings() : + aFirstDateTime( DateTime::EMPTY ), + aLastDateTime( DateTime::EMPTY ) { pCommentSearcher=NULL; bIsDate=false; diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx index 80dda704870e..e0f31580773e 100644 --- a/sc/inc/externalrefmgr.hxx +++ b/sc/inc/externalrefmgr.hxx @@ -404,6 +404,8 @@ private: { SfxObjectShellRef maShell; Time maLastAccess; + + SrcShell() : maLastAccess( Time::SYSTEM ) {} }; typedef ::boost::unordered_map<sal_uInt16, SrcShell> DocShellMap; diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 54feede763b9..e6596bb0dec5 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -780,7 +780,7 @@ bool lcl_ConvertFields(EditEngine& rEng, const String* pCommands) while ((nPos = aStr.Search(pCommands[2])) != STRING_NOTFOUND) { ESelection aSel( nPar,nPos, nPar,nPos+pCommands[2].Len() ); - rEng.QuickInsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD), aSel ); + rEng.QuickInsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SVXDATETYPE_VAR), EE_FEATURE_FIELD), aSel ); lcl_SetSpace(aStr, aSel ); bChange = true; } while ((nPos = aStr.Search(pCommands[3])) != STRING_NOTFOUND) diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index d37a536fc22f..a8881c0f15c6 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -540,7 +540,7 @@ ScPostIt* ScPostIt::Clone( const ScAddress& rOwnPos, ScDocument& rDestDoc, const void ScPostIt::AutoStamp() { - maNoteData.maDate = ScGlobal::pLocaleData->getDate( Date() ); + maNoteData.maDate = ScGlobal::pLocaleData->getDate( Date( Date::SYSTEM ) ); maNoteData.maAuthor = SvtUserOptions().GetID(); } diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index fc558dcbec78..30e6926bd8ae 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -462,7 +462,7 @@ void ScStyleSheetPool::CreateStandardStyles() aStr = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(", ")); pEdEngine->SetText( aStr ); pEdEngine->QuickInsertField( SvxFieldItem(SvxTimeField(), EE_FEATURE_FIELD), ESelection(0,2,0,2) ); - pEdEngine->QuickInsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD), + pEdEngine->QuickInsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SVXDATETYPE_VAR), EE_FEATURE_FIELD), ESelection() ); pTxtObj = pEdEngine->CreateTextObject(); pHeaderItem->SetRightArea( *pTxtObj ); diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index b63e5c6a207b..f04777356202 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -75,6 +75,7 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScChangeActionLinkEntry, nMemPoolChangeActionLinkEntry ScChangeAction::ScChangeAction( ScChangeActionType eTypeP, const ScRange& rRange ) : aBigRange( rRange ), + aDateTime( DateTime::SYSTEM ), pNext( NULL ), pPrev( NULL ), pLinkAny( NULL ), @@ -115,6 +116,7 @@ ScChangeAction::ScChangeAction( ScChangeActionType eTypeP, const ScBigRange& rRa const sal_uLong nTempAction) : aBigRange( rRange ), + aDateTime( DateTime::SYSTEM ), pNext( NULL ), pPrev( NULL ), pLinkAny( NULL ), @@ -2051,6 +2053,7 @@ SCROW ScChangeTrack::InitContentRowsPerSlot() ScChangeTrack::ScChangeTrack( ScDocument* pDocP ) : + aFixDateTime( DateTime::SYSTEM ), pDoc( pDocP ) { Init(); @@ -2062,6 +2065,7 @@ ScChangeTrack::ScChangeTrack( ScDocument* pDocP ) : ScChangeTrack::ScChangeTrack( ScDocument* pDocP, const ScStrCollection& aTempUserCollection) : aUserCollection(aTempUserCollection), + aFixDateTime( DateTime::SYSTEM ), pDoc( pDocP ) { Init(); diff --git a/sc/source/core/tool/chgviset.cxx b/sc/source/core/tool/chgviset.cxx index d2aa30580349..5d3f823ac21e 100644 --- a/sc/source/core/tool/chgviset.cxx +++ b/sc/source/core/tool/chgviset.cxx @@ -43,6 +43,9 @@ ScChangeViewSettings::~ScChangeViewSettings() } ScChangeViewSettings::ScChangeViewSettings( const ScChangeViewSettings& r ) + : + aFirstDateTime( DateTime::EMPTY ), + aLastDateTime( DateTime::EMPTY ) { SetTheComment(r.aComment); @@ -155,7 +158,7 @@ void ScChangeViewSettings::AdjustDateMode( const ScDocument& rDoc ) aFirstDateTime.SetDate( 18990101 ); aFirstDateTime.SetTime( 0 ); } - aLastDateTime = Date(); + aLastDateTime = Date( Date::SYSTEM ); aLastDateTime.SetYear( aLastDateTime.GetYear() + 100 ); } break; diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index 75d020a68596..b513cb26a14c 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -631,6 +631,9 @@ String lcl_GetNumStr( sal_Int32 nNo, SvxNumType eType ) } ScHeaderFieldData::ScHeaderFieldData() + : + aDate( Date::EMPTY ), + aTime( Time::EMPTY ) { nPageNo = nTotalPages = 0; eNumType = SVX_ARABIC; diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 5859a1a8df95..388c318b575c 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -111,7 +111,7 @@ void ScInterpreter::ScGetActDate() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScGetActDate" ); nFuncFmtType = NUMBERFORMAT_DATE; - Date aActDate; + Date aActDate( Date::SYSTEM ); long nDiff = aActDate - *(pFormatter->GetNullDate()); PushDouble((double) nDiff); } @@ -120,9 +120,9 @@ void ScInterpreter::ScGetActTime() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScGetActTime" ); nFuncFmtType = NUMBERFORMAT_DATETIME; - Date aActDate; + Date aActDate( Date::SYSTEM ); long nDiff = aActDate - *(pFormatter->GetNullDate()); - Time aActTime; + Time aActTime( Time::SYSTEM ); double nTime = ((double)aActTime.Get100Sec() / 100 + (double)(aActTime.GetSec() + (aActTime.GetMin() * 60) + diff --git a/sc/source/filter/excel/xlpivot.cxx b/sc/source/filter/excel/xlpivot.cxx index c6b2980a02e1..7c581c38ab70 100644 --- a/sc/source/filter/excel/xlpivot.cxx +++ b/sc/source/filter/excel/xlpivot.cxx @@ -48,7 +48,8 @@ namespace ScDPGroupBy = ::com::sun::star::sheet::DataPilotFieldGroupBy; // ============================================================================ XclPCItem::XclPCItem() : - meType( EXC_PCITEM_INVALID ) + meType( EXC_PCITEM_INVALID ), + maDateTime( DateTime::EMPTY ) { } diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx index 5f5687b7daf1..8ffc516812a7 100644 --- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx @@ -1476,7 +1476,7 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) : aRecList.push_back( new XclExpChTr0x0194( *pTempChangeTrack ) ); String sLastUsername; - DateTime aLastDateTime; + DateTime aLastDateTime( DateTime::EMPTY ); sal_uInt32 nIndex = 1; sal_Int32 nLogNumber = 1; while( XclExpChTrAction* pAction = aActionStack.Pop() ) diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx b/sc/source/filter/xcl97/XclImpChangeTrack.cxx index c69ef9590fe8..926c537b5aed 100644 --- a/sc/source/filter/xcl97/XclImpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclImpChangeTrack.cxx @@ -318,7 +318,7 @@ void XclImpChangeTrack::ReadChTrInfo() pStrm->Seek( 148 ); if( !pStrm->IsValid() ) return; - DateTime aDateTime; + DateTime aDateTime( DateTime::EMPTY ); ReadDateTime( aDateTime ); if( pStrm->IsValid() ) pChangeTrack->SetFixDateTimeLocal( aDateTime ); diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index bf4d6510ffab..570bb7f1b8f2 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2164,7 +2164,7 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque util::DateTime aDateTime; if (rChangeProps[i].Value >>= aDateTime) { - DateTime aCoreDateTime; + DateTime aCoreDateTime( DateTime::EMPTY ); ScXMLConverter::ConvertAPIToCoreDateTime(aDateTime, aCoreDateTime); pViewSettings->SetTheFirstDateTime(aCoreDateTime); } @@ -2174,7 +2174,7 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque util::DateTime aDateTime; if (rChangeProps[i].Value >>= aDateTime) { - DateTime aCoreDateTime; + DateTime aCoreDateTime( DateTime::EMPTY ); ScXMLConverter::ConvertAPIToCoreDateTime(aDateTime, aCoreDateTime); pViewSettings->SetTheLastDateTime(aCoreDateTime); } diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx index bb364774fb0b..238c202327a2 100644 --- a/sc/source/ui/dbgui/scendlg.cxx +++ b/sc/source/ui/dbgui/scendlg.cxx @@ -107,9 +107,9 @@ ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const String& rName, sal_Bo aComment.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ", " )); aComment += String( ScResId( STR_ON ) ); aComment += ' '; - aComment += ScGlobal::GetpLocaleData()->getDate( Date() ); + aComment += ScGlobal::GetpLocaleData()->getDate( Date( Date::SYSTEM ) ); aComment.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ", " )); - aComment += ScGlobal::GetpLocaleData()->getTime( Time() ); + aComment += ScGlobal::GetpLocaleData()->getTime( Time( Time::SYSTEM ) ); aEdComment .SetText( aComment ); aEdName .SetText( rName ); diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index a9497a239b31..82272c66d10c 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -2123,7 +2123,7 @@ const ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId) // document already loaded. SfxObjectShell* p = itr->second.maShell; - itr->second.maLastAccess = Time(); + itr->second.maLastAccess = Time( Time::SYSTEM ); return static_cast<ScDocShell*>(p)->GetDocument(); } @@ -2604,7 +2604,7 @@ void ScExternalRefManager::purgeStaleSrcDocument(sal_Int32 nTimeOut) for (; itr != itrEnd; ++itr) { // in 100th of a second. - sal_Int32 nSinceLastAccess = (Time() - itr->second.maLastAccess).GetTime(); + sal_Int32 nSinceLastAccess = (Time( Time::SYSTEM ) - itr->second.maLastAccess).GetTime(); if (nSinceLastAccess < nTimeOut) aNewDocShells.insert(*itr); else diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 82e73ae1cdb5..31944f3a048f 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -795,7 +795,6 @@ long ScAcceptChgDlg::PreNotify( NotifyEvent& rNEvt ) void ScAcceptChgDlg::UpdateView() { bNeedsUpdate=false; - DateTime aDateTime; SvLBoxEntry* pParent=NULL; ScChangeTrack* pChanges=NULL; const ScChangeAction* pScChangeAction=NULL; @@ -1464,7 +1463,6 @@ void ScAcceptChgDlg::AppendChanges(ScChangeTrack* pChanges,sal_uLong nStartActio { if(pChanges!=NULL) { - DateTime aDateTime; SvLBoxEntry* pParent=NULL; const ScChangeAction* pScChangeAction=NULL; bAcceptEnableFlag=true; diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx index e6778209fc70..d688d6d1c50c 100644 --- a/sc/source/ui/pagedlg/scuitphfedit.cxx +++ b/sc/source/ui/pagedlg/scuitphfedit.cxx @@ -686,7 +686,7 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling) aConfidentialEntry += ' '; aConfidentialEntry += ScGlobal::GetRscString( STR_HF_CONFIDENTIAL ); aWndLeft.GetEditEngine()->SetText(aConfidentialEntry); - aWndCenter.InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); + aWndCenter.InsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); aPageEntry += ' '; aWndRight.GetEditEngine()->SetText(aPageEntry); @@ -792,7 +792,7 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling) aPageEntry += ' '; aWndCenter.GetEditEngine()->SetText(aPageEntry); aWndCenter.InsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD) ); - aWndRight.InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); + aWndRight.InsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); if(!bTravelling) aWndRight.GrabFocus(); } @@ -807,7 +807,7 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling) aCreatedByEntry += ' '; aCreatedByEntry += (String)aUserOpt.GetLastName(); aWndLeft.GetEditEngine()->SetText(aCreatedByEntry); - aWndCenter.InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); + aWndCenter.InsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); aPageEntry += ' '; aWndRight.GetEditEngine()->SetText(aPageEntry); @@ -874,7 +874,7 @@ IMPL_LINK( ScHFEditPage, ClickHdl, ImageButton*, pBtn ) else if ( pBtn == &aBtnLastPage ) pActiveEdWnd->InsertField( SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD) ); else if ( pBtn == &aBtnDate ) - pActiveEdWnd->InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); + pActiveEdWnd->InsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); else if ( pBtn == &aBtnTime ) pActiveEdWnd->InsertField( SvxFieldItem(SvxTimeField(), EE_FEATURE_FIELD) ); else if ( pBtn == &aBtnFile ) diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 186205cd7409..1c0d37a733dd 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -104,6 +104,8 @@ ScPreview::ScPreview( Window* pParent, ScDocShell* pDocSh, ScPreviewShell* pView nTab( 0 ), nTabStart( 0 ), nDisplayStart( 0 ), + aDate( Date::SYSTEM ), + aTime( Time::SYSTEM ), nTotalPages( 0 ), pLocationData( NULL ), pDrawView( NULL ), @@ -657,8 +659,8 @@ void ScPreview::DataChanged(bool bNewTime) { if (bNewTime) { - aDate = Date(); - aTime = Time(); + aDate = Date( Date::SYSTEM ); + aTime = Time( Time::SYSTEM ); } bValid = false; diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index b6af96afcb27..e6484ceec031 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -1035,7 +1035,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions ) else aFieldData.nTotalPages = nTotalPages; - SetDateTime( Date(), Time() ); + SetDateTime( Date( Date::SYSTEM ), Time( Time::SYSTEM ) ); aFieldData.aTitle = pDocShell->GetTitle(); const INetURLObject& rURLObj = pDocShell->GetMedium()->GetURLObject(); diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index 1b7eb4c902f9..0f4736e2df8c 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -293,9 +293,9 @@ void ScViewFunc::InsertCurrentTime(short nCellFmt, const OUString& rUndoStr) ScDocument* pDoc = pDocSh->GetDocument(); ::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager(); SvNumberFormatter* pFormatter = pDoc->GetFormatTable(); - Date aActDate; + Date aActDate( Date::SYSTEM ); double fDate = aActDate - *pFormatter->GetNullDate(); - Time aActTime; + Time aActTime( Time::SYSTEM ); double fTime = aActTime.Get100Sec() / 100.0 + aActTime.GetSec() + (aActTime.GetMin() * 60.0) + (aActTime.GetHour() * 3600.0); diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 7348b63d71bd..6a9515d4f540 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -1457,7 +1457,7 @@ void SdPublishingDlg::SetDesign( SdPublishingDesign* pDesign ) pPage2_ChgDefault->Check( !pDesign->m_bAutoSlide ); pPage2_ChgAuto->Check( pDesign->m_bAutoSlide ); - Time aTime; + Time aTime( Time::EMPTY ); aTime.MakeTimeFromMS( pDesign->m_nSlideDuration * 1000 ); pPage2_Duration->SetTime( aTime ); diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 625ecd40013f..fdc9655b3406 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -168,11 +168,12 @@ OUString getAnnotationDateTimeString( const Reference< XAnnotation >& xAnnotatio com::sun::star::util::DateTime aDateTime( xAnnotation->getDateTime() ); + Date aSysDate( Date::SYSTEM ); Date aDate = Date( aDateTime.Day, aDateTime.Month, aDateTime.Year ); - if (aDate==Date()) + if (aDate==aSysDate) sRet = sRet + String(SdResId(STR_ANNOTATION_TODAY)); else - if (aDate == Date(Date()-1)) + if (aDate == Date(aSysDate-1)) sRet = sRet + String(SdResId(STR_ANNOTATION_YESTERDAY)); else if (aDate.IsValidAndGregorian() ) diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index 7d4ab169ef07..ceeaf6635cf2 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -389,8 +389,8 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo) } else { - Date aDate; - Time aTime; + Date aDate( Date::SYSTEM ); + Time aTime( Time::SYSTEM ); LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() ); aRepresentation = SvxDateTimeField::GetFormatted( aDate, aTime, (SvxDateFormat)rSettings.meDateTimeFormat, *GetNumberFormatter(), eLang ); } diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx index bfb350faed4e..65631d59ff61 100644 --- a/sd/source/ui/app/sdpopup.cxx +++ b/sd/source/ui/app/sdpopup.cxx @@ -223,7 +223,7 @@ SvxFieldData* SdFieldPopup::GetField() if( (pDateField->GetType() == SVXDATETYPE_VAR) && (eType == SVXDATETYPE_FIX) ) { - Date aDate; + Date aDate( Date::SYSTEM ); ( (SvxDateField*) pNewField )->SetFixDate( aDate ); } } @@ -256,7 +256,7 @@ SvxFieldData* SdFieldPopup::GetField() if( (pTimeField->GetType() == SVXTIMETYPE_VAR) && (eType == SVXTIMETYPE_FIX) ) { - Time aTime; + Time aTime( Time::SYSTEM ); ( (SvxExtTimeField*) pNewField )->SetFixTime( aTime ); } diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index 0e15017ebef1..e3e11d2305b2 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -575,8 +575,8 @@ void HeaderFooterTabPage::FillFormatList( int eFormat ) maCBDateTimeFormat.Clear(); - Date aDate; - Time aTime; + Date aDate( Date::SYSTEM ); + Time aTime( Time::SYSTEM ); int nFormat; for( nFormat = 0; nFormat < nDateTimeFormatsCount; nFormat++ ) diff --git a/sd/source/ui/tools/TimerBasedTaskExecution.cxx b/sd/source/ui/tools/TimerBasedTaskExecution.cxx index 42c1abc4b160..06061af5a251 100644 --- a/sd/source/ui/tools/TimerBasedTaskExecution.cxx +++ b/sd/source/ui/tools/TimerBasedTaskExecution.cxx @@ -147,14 +147,14 @@ IMPL_LINK(TimerBasedTaskExecution,TimerCallback, Timer*,EMPTYARG) // Execute as many steps as fit into the time span of length // mnMaxTimePerStep. Note that the last step may take longer // than allowed. - sal_uInt32 nStartTime (Time().GetMSFromTime()); + sal_uInt32 nStartTime (Time( Time::SYSTEM ).GetMSFromTime()); #ifdef VERBOSE OSL_TRACE("starting TimerBasedTaskExecution at %d", nStartTime); #endif do { mpTask->RunNextStep(); - sal_uInt32 nDuration (Time().GetMSFromTime()-nStartTime); + sal_uInt32 nDuration (Time( Time::SYSTEM ).GetMSFromTime()-nStartTime); #ifdef VERBOSE OSL_TRACE("executed step in %d", nDuration); #endif diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 22f02fccbcd9..1a49b7f97fa5 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1546,7 +1546,7 @@ void ImplPDFExportComments( uno::Reference< drawing::XDrawPage > xPage, vcl::PDF util::DateTime aDateTime( xAnnotation->getDateTime() ); Date aDate( aDateTime.Day, aDateTime.Month, aDateTime.Year ); - Time aTime; + Time aTime( Time::EMPTY ); String aStr( SvxDateTimeField::GetFormatted( aDate, aTime, SVXDATEFORMAT_B, *(SD_MOD()->GetNumberFormatter()), eLanguage ) ); vcl::PDFNote aNote; diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index c917d2a1c11d..0d15f445df00 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1500,12 +1500,12 @@ private: // Collect some frequently used data. if (mpOptions->IsDate()) { - aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getDate( Date() ); + aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getDate( Date( Date::SYSTEM ) ); aInfo.msTimeDate += ::rtl::OUString((sal_Unicode)' '); } if (mpOptions->IsTime()) - aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( Time(), sal_False, sal_False ); + aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( Time( Time::SYSTEM ), sal_False, sal_False ); aInfo.maPrintSize = aInfo.mpPrinter->GetOutputSize(); maPrintSize = awt::Size( aInfo.mpPrinter->GetPaperSize().Width(), diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx index 4826ec7b8d89..27ba35427e3d 100644 --- a/sd/source/ui/view/drviewsb.cxx +++ b/sd/source/ui/view/drviewsb.cxx @@ -500,7 +500,7 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq) { case SID_INSERT_FLD_DATE_FIX: pFieldItem = new SvxFieldItem( - SvxDateField( Date(), SVXDATETYPE_FIX ), EE_FEATURE_FIELD ); + SvxDateField( Date( Date::SYSTEM ), SVXDATETYPE_FIX ), EE_FEATURE_FIELD ); break; case SID_INSERT_FLD_DATE_VAR: @@ -509,7 +509,7 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq) case SID_INSERT_FLD_TIME_FIX: pFieldItem = new SvxFieldItem( - SvxExtTimeField( Time(), SVXTIMETYPE_FIX ), EE_FEATURE_FIELD ); + SvxExtTimeField( Time( Time::SYSTEM ), SVXTIMETYPE_FIX ), EE_FEATURE_FIELD ); break; case SID_INSERT_FLD_TIME_VAR: diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index 068b0a33cf21..3e16529d1554 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -460,7 +460,7 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) { case SID_INSERT_FLD_DATE_FIX: pFieldItem = new SvxFieldItem( - SvxDateField( Date(), SVXDATETYPE_FIX ), EE_FEATURE_FIELD ); + SvxDateField( Date( Date::SYSTEM ), SVXDATETYPE_FIX ), EE_FEATURE_FIELD ); break; case SID_INSERT_FLD_DATE_VAR: @@ -469,7 +469,7 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) case SID_INSERT_FLD_TIME_FIX: pFieldItem = new SvxFieldItem( - SvxExtTimeField( Time(), SVXTIMETYPE_FIX ), EE_FEATURE_FIELD ); + SvxExtTimeField( Time( Time::SYSTEM ), SVXTIMETYPE_FIX ), EE_FEATURE_FIELD ); break; case SID_INSERT_FLD_TIME_VAR: diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 98ac2d66e065..b0169a5a13a5 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -332,7 +332,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint ) pDocSh->getDocProperties()); if (xDocProps.is()) { xDocProps->setAuthor( SvtUserOptions().GetFullName() ); - ::DateTime now; + ::DateTime now( ::DateTime::SYSTEM ); xDocProps->setCreationDate( util::DateTime( now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), now.GetDay(), now.GetMonth(), diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx index a76c0fb95513..2e1d79c1ea4a 100644 --- a/sfx2/source/bastyp/helper.cxx +++ b/sfx2/source/bastyp/helper.cxx @@ -76,7 +76,7 @@ typedef vector< OUString* > StringList_Impl; void AppendDateTime_Impl( const util::DateTime rDT, String& rRow, const LocaleDataWrapper& rWrapper ) { - DateTime aDT; + DateTime aDT( DateTime::EMPTY ); CONVERT_DATETIME( rDT, aDT ); String aDateStr = rWrapper.getDate( aDT ); aDateStr += String::CreateFromAscii( ", " ); diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index ca68dcf35b34..ac3858cac3ae 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -377,7 +377,7 @@ int SfxDocumentInfoItem::operator==( const SfxPoolItem& rItem) const void SfxDocumentInfoItem::resetUserData(const ::rtl::OUString & i_rAuthor) { setAuthor(i_rAuthor); - DateTime now; + DateTime now( DateTime::SYSTEM ); setCreationDate( util::DateTime( now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), now.GetDay(), now.GetMonth(), now.GetYear() ) ); @@ -884,7 +884,7 @@ IMPL_LINK( SfxDocumentPage, DeleteHdl, PushButton*, EMPTYARG ) if ( bEnableUseUserData && aUseUserDataCB.IsChecked() ) aName = SvtUserOptions().GetFullName(); LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); - DateTime now; + DateTime now( DateTime::SYSTEM ); util::DateTime uDT( now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), now.GetDay(), now.GetMonth(), now.GetYear() ); diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index 88c4fa6b6d96..8c5d14ddf686 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -66,6 +66,7 @@ struct SfxVersionInfo SfxVersionInfo(); SfxVersionInfo( const SfxVersionInfo& rInfo ) + : aCreationDate( DateTime::EMPTY ) { *this = rInfo; } SfxVersionInfo& operator=( const SfxVersionInfo &rInfo ) @@ -142,6 +143,7 @@ SfxVersionTableDtor& SfxVersionTableDtor::operator=( const SfxVersionTableDtor& //---------------------------------------------------------------- SfxVersionInfo::SfxVersionInfo() + : aCreationDate( DateTime::EMPTY ) { } @@ -325,7 +327,7 @@ void SfxVersionDialog::Open_Impl() void SfxVersionDialog::RecalcDateColumn() { // recalculate the datetime column width - DateTime aNow; + DateTime aNow( DateTime::SYSTEM ); mpLocaleWrapper = new LocaleDataWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); String sDateTime = ConvertDateTime_Impl( aNow, *mpLocaleWrapper ); diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index cbe1ec9a3865..a46318d36672 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -1883,7 +1883,7 @@ SfxDocumentMetaData::resetUserData(const ::rtl::OUString & the_value) bool bModified( false ); bModified |= setMetaText("meta:initial-creator", the_value); - ::DateTime now = DateTime(); + ::DateTime now( ::DateTime::SYSTEM ); css::util::DateTime uDT(now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), now.GetDay(), now.GetMonth(), now.GetYear()); bModified |= setMetaText("meta:creation-date", dateTimeToText(uDT)); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 097eba93135e..fd2fb1ecfbc7 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -340,7 +340,7 @@ SfxMedium_Impl::SfxMedium_Impl( SfxMedium* pAntiImplP ) pAntiImpl( pAntiImplP ), nFileVersion( 0 ), pOrigFilter( 0 ), - aExpireTime( Date() + 10, Time() ), + aExpireTime( Date( Date::SYSTEM ) + 10, Time( Time::SYSTEM ) ), pTempFile( NULL ), nLastStorageError( 0 ), m_bRemoveBackup( sal_False ), @@ -2969,7 +2969,7 @@ void SfxMedium::SetExpired_Impl( const DateTime& rDateTime ) sal_Bool SfxMedium::IsExpired() const { - return pImp->aExpireTime.IsValidAndGregorian() && pImp->aExpireTime < DateTime(); + return pImp->aExpireTime.IsValidAndGregorian() && pImp->aExpireTime < DateTime( DateTime::SYSTEM ); } //---------------------------------------------------------------- diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 7c061a76ffd3..9e3a1378de3e 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -206,7 +206,7 @@ void SfxObjectShell::UpdateDocInfoForSave() else { // update ModificationAuthor, revision and editing time - ::DateTime now; + ::DateTime now( ::DateTime::SYSTEM ); xDocProps->setModificationDate( util::DateTime( now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), now.GetDay(), now.GetMonth(), @@ -241,7 +241,7 @@ void SfxObjectShell::UpdateTime_Impl( secs/3600, (secs%3600)/60, secs%60, 0); // Initialize some local member! Its neccessary for wollow operations! - DateTime aNow ; // Date and time at current moment + DateTime aNow( DateTime::SYSTEM ); // Date and time at current moment Time n24Time (24,0,0,0) ; // Time-value for 24 hours - see follow calculation sal_uIntPtr nDays = 0 ; // Count of days between now and last editing Time nAddTime (0) ; // Value to add on aOldTime @@ -1009,7 +1009,7 @@ void SfxObjectShell::ResetFromTemplate( const String& rTemplateName, const Strin xDocProps->setTemplateURL( aObj.GetMainURL(INetURLObject::DECODE_TO_IURI) ); xDocProps->setTemplateName( rTemplateName ); - ::DateTime now; + ::DateTime now( ::DateTime::SYSTEM ); xDocProps->setTemplateDate( util::DateTime( now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), now.GetDay(), now.GetMonth(), diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 5827defcae7f..a84206d26d52 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1673,7 +1673,7 @@ void SfxHeaderAttributes_Impl::SetAttribute( const SvKeyValue& rKV ) } else if( rKV.GetKey().CompareIgnoreCaseToAscii( "expires" ) == COMPARE_EQUAL ) { - DateTime aDateTime; + DateTime aDateTime( DateTime::EMPTY ); if( INetRFC822Message::ParseDateField( rKV.GetValue(), aDateTime ) ) { aDateTime.ConvertToLocalTime(); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index cbaf44347723..db5682fa9d00 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -1490,7 +1490,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl // if not transferred as a parameter, get it from user settings aInfo.Author = SvtUserOptions().GetFullName(); - DateTime aTime; + DateTime aTime( DateTime::SYSTEM ); aInfo.TimeStamp.Day = aTime.GetDay(); aInfo.TimeStamp.Month = aTime.GetMonth(); aInfo.TimeStamp.Year = aTime.GetYear(); diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 1aab3b0f02a0..d4e8b5643304 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -222,7 +222,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,rDocShell( _rDocShell ) ,aMacroMode( *this ) ,pProgress( 0) - ,nTime() + ,nTime( DateTime::EMPTY ) ,nVisualDocumentNumber( USHRT_MAX) ,nDocumentSignatureState( SIGNATURESTATE_UNKNOWN ) ,nScriptingSignatureState( SIGNATURESTATE_UNKNOWN ) diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index fd8d3f6c9e14..eec04ce016d3 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -320,7 +320,7 @@ void SfxPrinterController::jobStarted() xDocProps->setPrintedBy( mpObjectShell->IsUseUserData() ? ::rtl::OUString( SvtUserOptions().GetFullName() ) : ::rtl::OUString() ); - ::DateTime now; + ::DateTime now( ::DateTime::SYSTEM ); xDocProps->setPrintDate( util::DateTime( now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), diff --git a/svl/source/items/dateitem.cxx b/svl/source/items/dateitem.cxx index 67ed22985c6b..e5329958f127 100644 --- a/svl/source/items/dateitem.cxx +++ b/svl/source/items/dateitem.cxx @@ -55,7 +55,8 @@ TYPEINIT1(SfxDateTimeItem, SfxPoolItem); // ----------------------------------------------------------------------- SfxDateTimeItem::SfxDateTimeItem( sal_uInt16 which ) : - SfxPoolItem( which ) + SfxPoolItem( which ), + aDateTime( DateTime::SYSTEM ) { DBG_CTOR(SfxDateTimeItem, 0); } diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 556981e3981b..6e1cde011235 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -1017,7 +1017,7 @@ bool ImpSvNumberInputScan::GetDateRef( double& fDays, sal_uInt16& nCounter, CalendarWrapper* pCal = pFormatter->GetCalendar(); for ( int nTryOrder = 1; nTryOrder <= nFormatOrder; nTryOrder++ ) { - pCal->setGregorianDateTime( Date() ); // today + pCal->setGregorianDateTime( Date( Date::SYSTEM ) ); // today String aOrgCalendar; // empty => not changed yet DateFormat DateFmt; bool bFormatTurn; @@ -1207,7 +1207,7 @@ input for the following reasons: if ( !bHadExact || !pCal->isValid() ) { if ( !bHadExact && nExactDateOrder ) - pCal->setGregorianDateTime( Date() ); // reset today + pCal->setGregorianDateTime( Date( Date::SYSTEM ) ); // reset today switch (DateFmt) { case MDY: diff --git a/svtools/source/contnr/contentenumeration.hxx b/svtools/source/contnr/contentenumeration.hxx index 70e9a2a0fbc9..c8e42bae4fc3 100644 --- a/svtools/source/contnr/contentenumeration.hxx +++ b/svtools/source/contnr/contentenumeration.hxx @@ -84,6 +84,7 @@ namespace svt }; inline SortingData_Impl::SortingData_Impl() : + maModDate ( DateTime::EMPTY ), maSize ( 0 ), mbIsFolder ( sal_False ), mbIsVolume ( sal_False ), diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx index 4ff76c3e23e2..e1d536dee22d 100644 --- a/svtools/source/control/calendar.cxx +++ b/svtools/source/control/calendar.cxx @@ -291,6 +291,7 @@ Calendar::Calendar( Window* pParent, WinBits nWinStyle ) : maOldFormatLastDate( 0, 0, 1900 ), maFirstDate( 0, 0, 1900 ), maOldFirstDate( 0, 0, 1900 ), + maCurDate( Date::SYSTEM ), maOldCurDate( 0, 0, 1900 ), maAnchorDate( maCurDate ), maDropDate( 0, 0, 1900 ) @@ -867,7 +868,7 @@ void Calendar::ImplDrawDate( long nX, long nY, if ( nToday ) aTodayDate.SetDate( nToday ); else - aTodayDate = Date(); + aTodayDate = Date( Date::SYSTEM ); if ( (nDay == aTodayDate.GetDay()) && (nMonth == aTodayDate.GetMonth()) && (nYear == aTodayDate.GetYear()) ) @@ -932,7 +933,7 @@ void Calendar::ImplDraw( sal_Bool bPaint ) long nDeltaY; long nDayX; long nDayY; - sal_uLong nToday = Date().GetDate(); + sal_uLong nToday = Date( Date::SYSTEM ).GetDate(); sal_uInt16 nDay; sal_uInt16 nMonth; sal_uInt16 nYear; @@ -2590,7 +2591,7 @@ IMPL_LINK( CalendarField, ImplClickHdl, PushButton*, pBtn ) if ( pBtn == mpTodayBtn ) { - Date aToday; + Date aToday( Date::SYSTEM ); if ( (aToday != GetDate()) || IsEmptyDate() ) { SetDate( aToday ); @@ -2643,7 +2644,7 @@ sal_Bool CalendarField::ShowDropDown( sal_Bool bShow ) if ( maDefaultDate.IsValidAndGregorian() ) aDate = maDefaultDate; else - aDate = Date(); + aDate = Date( Date::SYSTEM ); } if ( pCalendar->GetStyle() & (WB_RANGESELECT | WB_MULTISELECT) ) { diff --git a/svtools/source/control/taskstat.cxx b/svtools/source/control/taskstat.cxx index 74110c61cb1d..20b731bcc2da 100644 --- a/svtools/source/control/taskstat.cxx +++ b/svtools/source/control/taskstat.cxx @@ -201,7 +201,7 @@ sal_Bool TaskStatusBar::ImplUpdateClock() { if ( mnFieldFlags & TASKSTATUSFIELD_CLOCK ) { - Time aTime; + Time aTime( Time::SYSTEM ); maTimer.SetTimeout( ((long)60000)-((aTime.GetSec()*1000)+(aTime.Get100Sec()*10)) ); if ( (aTime.GetMin() != maTime.GetMin()) || (aTime.GetHour() != maTime.GetHour()) ) @@ -457,7 +457,7 @@ void TaskStatusBar::RequestHelp( const HelpEvent& rHEvt ) const LocaleDataWrapper& rLDW = aSL.GetLocaleData(); CalendarWrapper aCal( rLDW.getServiceFactory()); aCal.loadDefaultCalendar( rLDW.getLoadedLocale()); - XubString aStr = rLDW.getLongDate( Date(), aCal ); + XubString aStr = rLDW.getLongDate( Date( Date::SYSTEM), aCal ); if ( rHEvt.GetMode() & HELPMODE_BALLOON ) Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aStr ); else diff --git a/svx/inc/svx/galmisc.hxx b/svx/inc/svx/galmisc.hxx index e6f6c8edd23f..c7ed89c2f953 100644 --- a/svx/inc/svx/galmisc.hxx +++ b/svx/inc/svx/galmisc.hxx @@ -57,6 +57,11 @@ struct ExchangeData String aEditedTitle; Date aThemeChangeDate; Time aThemeChangeTime; + + ExchangeData() : + aThemeChangeDate( Date::EMPTY ), + aThemeChangeTime( Time::EMPTY ) + {} }; enum SgaObjKind diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 3d0c4ec8adef..7494f3283bfb 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -65,6 +65,8 @@ static long nStaticTabs[]= #define CALC_DATE 3 RedlinData::RedlinData() + : + aDateTime( DateTime::EMPTY ) { bDisabled=sal_False; pData=NULL; @@ -146,7 +148,11 @@ void SvLBoxColorString::Paint( const Point& rPos, SvLBox& rDev, //---------------------------------------------------------------------------- SvxRedlinTable::SvxRedlinTable(SvxSimpleTableContainer& rParent,WinBits nBits) - : SvxSimpleTable(rParent,nBits) + : SvxSimpleTable(rParent,nBits), + aDaTiFirst( DateTime::EMPTY ), + aDaTiLast( DateTime::EMPTY ), + aDaTiFilterFirst( DateTime::EMPTY ), + aDaTiFilterLast( DateTime::EMPTY ) { bAuthor=sal_False; bDate=sal_False; @@ -158,7 +164,11 @@ SvxRedlinTable::SvxRedlinTable(SvxSimpleTableContainer& rParent,WinBits nBits) } SvxRedlinTable::SvxRedlinTable(SvxSimpleTableContainer& rParent,const ResId& rResId) - : SvxSimpleTable(rParent,rResId) + : SvxSimpleTable(rParent,rResId), + aDaTiFirst( DateTime::EMPTY ), + aDaTiLast( DateTime::EMPTY ), + aDaTiFilterFirst( DateTime::EMPTY ), + aDaTiFilterLast( DateTime::EMPTY ) { bAuthor=sal_False; bDate=sal_False; @@ -232,7 +242,7 @@ void SvxRedlinTable::SetCalcView(sal_Bool bFlag) void SvxRedlinTable::UpdateFilterTest() { - Date aDateMax; + Date aDateMax( Date::SYSTEM ); sal_uInt16 nYEAR=aDateMax.GetYear()+100; aDateMax.SetYear(nYEAR); Date aDateMin(1,1,1989); @@ -797,8 +807,8 @@ SvxTPFilter::SvxTPFilter( Window * pParent) RowEnableHdl(&aCbRange); RowEnableHdl(&aCbComment); - Date aDate; - Time aTime; + Date aDate( Date::SYSTEM ); + Time aTime( Time::SYSTEM ); aDfDate.SetDate(aDate); aTfDate.SetTime(aTime); aDfDate2.SetDate(aDate); @@ -1177,8 +1187,8 @@ IMPL_LINK( SvxTPFilter, RowEnableHdl, CheckBox*, pCB ) IMPL_LINK( SvxTPFilter, TimeHdl, ImageButton*,pIB ) { - Date aDate; - Time aTime; + Date aDate( Date::SYSTEM ); + Time aTime( Time::SYSTEM ); if(pIB==&aIbClock) { aDfDate.SetDate(aDate); @@ -1275,7 +1285,7 @@ void SvxTPFilter::Disable( bool bChild) IMPL_LINK( SvxTPFilter, ModifyDate, void*,pTF) { - Date aDate; + Date aDate( Date::SYSTEM ); Time aTime(0); if(&aDfDate==pTF) { diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index af58c523afda..4c50608b0369 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -236,7 +236,7 @@ void GalleryBrowser1::ImplFillExchangeData( const GalleryTheme* pThm, ExchangeDa { ::ucbhelper::Content aCnt( pThm->GetThmURL().GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment >() ); util::DateTime aDateTimeModified; - DateTime aDateTime; + DateTime aDateTime( DateTime::EMPTY ); aCnt.getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "DateModified" )) ) >>= aDateTimeModified; ::utl::typeConvert( aDateTimeModified, aDateTime ); diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index a5ef15cd7c29..3e8daa2e1791 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -218,6 +218,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe } SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal_Bool bLoadRefCounts): + aReadDate( DateTime::EMPTY ), maMaPag(1024,32,32), maPages(1024,32,32) { @@ -230,6 +231,7 @@ SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal } SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal_Bool bLoadRefCounts): + aReadDate( DateTime::EMPTY ), maMaPag(1024,32,32), maPages(1024,32,32), aTablePath(rPath) @@ -243,6 +245,7 @@ SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbed } SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable, sal_Bool bLoadRefCounts): + aReadDate( DateTime::EMPTY ), maMaPag(1024,32,32), maPages(1024,32,32) { @@ -255,6 +258,7 @@ SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, boo } SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable, sal_Bool bLoadRefCounts): + aReadDate( DateTime::EMPTY ), maMaPag(1024,32,32), maPages(1024,32,32), aTablePath(rPath) @@ -270,6 +274,7 @@ SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbed SdrModel::SdrModel(const SdrModel& /*rSrcModel*/): SfxBroadcaster(), tools::WeakBase< SdrModel >(), + aReadDate( DateTime::EMPTY ), maMaPag(1024,32,32), maPages(1024,32,32) { diff --git a/svx/source/svdraw/svdotxln.cxx b/svx/source/svdraw/svdotxln.cxx index 0704d1f74caa..5b0afd807c6b 100644 --- a/svx/source/svdraw/svdotxln.cxx +++ b/svx/source/svdraw/svdotxln.cxx @@ -115,6 +115,7 @@ TYPEINIT1(ImpSdrObjTextLinkUserData,SdrObjUserData); ImpSdrObjTextLinkUserData::ImpSdrObjTextLinkUserData(SdrTextObj* pObj1): SdrObjUserData(SdrInventor,SDRUSERDATA_OBJTEXTLINK,0), pObj(pObj1), + aFileDate0( DateTime::EMPTY ), pLink(NULL), eCharSet(RTL_TEXTENCODING_DONTKNOW) { @@ -175,7 +176,7 @@ bool SdrTextObj::ReloadLinkedText( bool bForceLoad) if( pData ) { ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get(); - DateTime aFileDT; + DateTime aFileDT( DateTime::EMPTY ); sal_Bool bExists = sal_False, bLoad = sal_False; if( pBroker ) diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 41052a68eca0..8f4f56d59ff2 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -1399,7 +1399,7 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo ) // get the Author / TimeStamp from the "other" document info sal_uInt16 nAuthor = rDoc.GetRedlineAuthor(); - DateTime aTimeStamp; + DateTime aTimeStamp( DateTime::SYSTEM ); SwDocShell *pDocShell(rDoc.GetDocShell()); OSL_ENSURE(pDocShell, "no SwDocShell"); if (pDocShell) { diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 91268acd3023..019e1606022e 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -1996,8 +1996,8 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) } else { - nDate = Date().GetDate(); - nTime = Time().GetTime(); + nDate = Date( Date::SYSTEM ).GetDate(); + nTime = Time( Time::SYSTEM ).GetTime(); } sal_uInt16 aTypes[5] = { diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 531efd7b94f1..1be1ccfb3fb1 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -244,7 +244,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, bool bOutline, c utl::TempFile aTemp(sLeading,&sExt,&sPath ); aTemp.EnableKillingFile(); - DateTime aTmplDate; + DateTime aTmplDate( DateTime::SYSTEM ); { Time a2Min( 0 ); a2Min.SetMin( 2 ); aTmplDate += a2Min; diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 4eff3d9f2211..d5a609a99977 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -2225,8 +2225,8 @@ String SwDoc::GetUniqueNumRuleName( const String* pChkStr, sal_Bool bAutoNum ) c String aName; if( bAutoNum ) { - long n = Time().GetTime(); - n += Date().GetDate(); + long n = Time( Time::SYSTEM ).GetTime(); + n += Date( Date::SYSTEM ).GetDate(); aName = String::CreateFromInt32( n ); if( pChkStr && !pChkStr->Len() ) pChkStr = 0; @@ -2611,8 +2611,8 @@ namespace listfunc { // #i92478# String aNewListId = String::CreateFromAscii( "list" ); - sal_Int64 n = Time().GetTime(); - n += Date().GetDate(); + sal_Int64 n = Time( Time::SYSTEM ).GetTime(); + n += Date( Date::SYSTEM ).GetDate(); n += rand(); // #i92478# aNewListId += String::CreateFromInt64( n ); diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index ff4299500e14..a17510483cd5 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -2987,7 +2987,9 @@ int SwRedlineExtraData_Format::operator == ( const SwRedlineExtraData& rCmp ) co } SwRedlineData::SwRedlineData( RedlineType_t eT, sal_uInt16 nAut ) - : pNext( 0 ), pExtraData( 0 ), eType( eT ), nAuthor( nAut ), nSeqNo( 0 ) + : pNext( 0 ), pExtraData( 0 ), + aStamp( DateTime::SYSTEM ), + eType( eT ), nAuthor( nAut ), nSeqNo( 0 ) { aStamp.SetSec( 0 ); aStamp.Set100Sec( 0 ); diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx index 86923a9acfb1..22cd105022f1 100644 --- a/sw/source/core/fields/flddat.cxx +++ b/sw/source/core/fields/flddat.cxx @@ -69,7 +69,7 @@ SwDateTimeField::SwDateTimeField(SwDateTimeFieldType* pInitType, sal_uInt16 nSub } if (IsFixed()) { - DateTime aDateTime; + DateTime aDateTime( DateTime::SYSTEM ); SetDateTime(aDateTime); } } @@ -80,7 +80,7 @@ String SwDateTimeField::Expand() const if (!(IsFixed())) { - DateTime aDateTime; + DateTime aDateTime( DateTime::SYSTEM ); fVal = GetDateTime(GetDoc(), aDateTime); } else @@ -148,7 +148,7 @@ double SwDateTimeField::GetValue() const if (IsFixed()) return SwValueField::GetValue(); else - return GetDateTime(GetDoc(), DateTime()); + return GetDateTime(GetDoc(), DateTime( DateTime::SYSTEM )); } Date SwDateTimeField::GetDate(sal_Bool bUseOffset) const @@ -248,7 +248,7 @@ bool SwDateTimeField::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId ) util::DateTime aDateTimeValue; if(!(rVal >>= aDateTimeValue)) return sal_False; - DateTime aDateTime; + DateTime aDateTime( DateTime::EMPTY ); aDateTime.Set100Sec(aDateTimeValue.HundredthSeconds); aDateTime.SetSec(aDateTimeValue.Seconds); aDateTime.SetMin(aDateTimeValue.Minutes); diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx index 95a45a14a289..de04be42e9e5 100644 --- a/sw/source/core/swg/swblocks.cxx +++ b/sw/source/core/swg/swblocks.cxx @@ -101,7 +101,10 @@ short SwImpBlocks::GetFileType( const String& rFile ) SwImpBlocks::SwImpBlocks( const String& rFile, sal_Bool ) - : aFile( rFile ), pDoc( 0 ), nCur( (sal_uInt16)-1 ), + : aFile( rFile ), + aDateModified( Date::EMPTY ), + aTimeModified( Time::EMPTY ), + pDoc( 0 ), nCur( (sal_uInt16)-1 ), bReadOnly( sal_True ), bInPutMuchBlocks( sal_False ) { FStatHelper::GetModifiedDateTimeOfFile( rFile, diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 92c7e1c3f7ea..6b0ddc7ccbe9 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -1049,6 +1049,7 @@ struct SwFieldProperties_Impl sal_Bool bBool4; SwFieldProperties_Impl(): + aDate( Date::EMPTY ), fDouble(0.), pDateTime(0), nSubType(0), @@ -1231,7 +1232,7 @@ void SwXTextField::attachToRange( { SwFieldType* pFldType = pDoc->GetSysFldType(RES_POSTITFLD); - DateTime aDateTime; + DateTime aDateTime( DateTime::EMPTY ); if (m_pProps->pDateTime) { aDateTime.SetYear(m_pProps->pDateTime->Year); @@ -2233,7 +2234,7 @@ void SwXTextField::update( ) throw (uno::RuntimeException) switch(pFld->Which()) { case RES_DATETIMEFLD: - ((SwDateTimeField*)pFld)->SetDateTime( ::DateTime() ); + ((SwDateTimeField*)pFld)->SetDateTime( ::DateTime( ::DateTime::SYSTEM ) ); break; case RES_EXTUSERFLD: diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index 5afbe92a538b..dc5c8a7d9ab6 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -441,7 +441,11 @@ SwReader::SwReader( const uno::Reference < embed::XStorage > &rStg, const String } Reader::Reader() - : pTemplate(0), pStrm(0), pMedium(0), bInsertMode(0), + : pTemplate(0), + aDStamp( Date::EMPTY ), + aTStamp( Time::EMPTY ), + aChkDateTime( DateTime::EMPTY ), + pStrm(0), pMedium(0), bInsertMode(0), bTmplBrowseMode(0), bReadUTF8(0), bBlockMode(0), bOrganizerMode(0), bHasAskTemplateName(0), bIgnoreHTMLComments(0) { @@ -473,15 +477,15 @@ SwDoc* Reader::GetTemplateDoc() INetURLObject aTDir( aTemplateNm ); String aFileName = aTDir.GetMainURL( INetURLObject::NO_DECODE ); OSL_ENSURE( !aTDir.HasError(), "No absolute path for template name!" ); - DateTime aCurrDateTime; + DateTime aCurrDateTime( DateTime::SYSTEM ); sal_Bool bLoad = sal_False; // Wenn das Template schon mal geladen wurde, nur einmal pro // Minute nachschauen, ob es geaendert wurde. if( !pTemplate || aCurrDateTime >= aChkDateTime ) { - Date aTstDate; - Time aTstTime; + Date aTstDate( Date::EMPTY ); + Time aTstTime( Time::EMPTY ); if( FStatHelper::GetModifiedDateTimeOfFile( aTDir.GetMainURL( INetURLObject::NO_DECODE ), &aTstDate, &aTstTime ) && diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index 71de0feb0dfd..1c28e7daf65e 100644 --- a/sw/source/filter/html/htmlfld.cxx +++ b/sw/source/filter/html/htmlfld.cxx @@ -339,7 +339,7 @@ void SwHTMLParser::NewField() case RES_TIMEFLD: { sal_uLong nNumFmt = 0; - sal_uLong nTime = Time().GetTime(), nDate = Date().GetDate(); + sal_uLong nTime = Time( Time::SYSTEM ).GetTime(), nDate = Date( Date::SYSTEM ).GetDate(); sal_uInt16 nSub = 0; sal_Bool bValidFmt = sal_False; HTMLNumFmtTblEntry * pFmtTbl; @@ -659,7 +659,7 @@ void SwHTMLParser::InsertComment( const String& rComment, const sal_Char *pTag ) SwPostItField aPostItFld( (SwPostItFieldType*)pDoc->GetSysFldType( RES_POSTITFLD ), - aEmptyStr, aComment, DateTime() ); + aEmptyStr, aComment, DateTime( DateTime::SYSTEM ) ); InsertAttr( SwFmtFld( aPostItFld ) ); if( bMoveFwd ) diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index b8ddf9d7abb3..3dc5337b49ab 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -5382,7 +5382,7 @@ void SwHTMLParser::ParseMoreMetaOptions() SwPostItField aPostItFld( (SwPostItFieldType*)pDoc->GetSysFldType( RES_POSTITFLD ), - aEmptyStr, sText, DateTime() ); + aEmptyStr, sText, DateTime( DateTime::SYSTEM ) ); SwFmtFld aFmtFld( aPostItFld ); InsertAttr( aFmtFld ); } diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index 909900edd948..0533799c410d 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -232,7 +232,9 @@ public: RedlineType_t eTypePrev_ = nsRedlineType_t::REDLINE_INSERT, sal_uInt16 nAutorNoPrev_ = USHRT_MAX, const DateTime* pStampPrev_ = 0) - : SfxPoolItem(RES_FLTR_REDLINE), aStamp(rStamp_), eType(eType_), + : SfxPoolItem(RES_FLTR_REDLINE), aStamp(rStamp_), + aStampPrev( DateTime::EMPTY ), + eType(eType_), eTypePrev(eTypePrev_), nAutorNo(nAutorNo_), nAutorNoPrev(nAutorNoPrev_) { if( pStampPrev_ ) diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 1841e719ffd0..2207f37431b5 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1909,6 +1909,8 @@ void WW8_WrPlcFtnEdn::Append( WW8_CP nCp, const SwFmtFtn& rFtn ) } WW8_Annotation::WW8_Annotation(const SwPostItField* pPostIt) + : + maDateTime( DateTime::EMPTY ) { mpRichText = pPostIt->GetTextObject(); if (!mpRichText) @@ -1917,7 +1919,10 @@ WW8_Annotation::WW8_Annotation(const SwPostItField* pPostIt) maDateTime = DateTime(pPostIt->GetDate(), pPostIt->GetTime()); } -WW8_Annotation::WW8_Annotation(const SwRedlineData* pRedline) : mpRichText(0) +WW8_Annotation::WW8_Annotation(const SwRedlineData* pRedline) + : + mpRichText(0), + maDateTime( DateTime::EMPTY ) { msSimpleText = pRedline->GetComment(); msOwner = SW_MOD()->GetRedlineAuthor(pRedline->GetAuthor()); diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index 4745b00fae32..49a3110ce462 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -728,7 +728,7 @@ SwRedlineData* XMLRedlineImportHelper::ConvertRedline( pDoc->InsertRedlineAuthor( pRedlineInfo->sAuthor ); // 2) util::DateTime -> DateTime - DateTime aDT; + DateTime aDT( DateTime::EMPTY ); aDT.SetYear( pRedlineInfo->aDateTime.Year ); aDT.SetMonth( pRedlineInfo->aDateTime.Month ); aDT.SetDay( pRedlineInfo->aDateTime.Day ); diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx index 311e5bdd1dab..da0f8884c9cd 100644 --- a/sw/source/ui/docvw/SidebarWin.cxx +++ b/sw/source/ui/docvw/SidebarWin.cxx @@ -406,12 +406,13 @@ void SwSidebarWin::CheckMetaText() mpMetadataAuthor->SetText(sMeta); } + Date aSysDate( Date::SYSTEM ); Date aDate = GetDate(); - if (aDate==Date()) + if (aDate==aSysDate) { sMeta = String(SW_RES(STR_POSTIT_TODAY)); } - else if (aDate == Date(Date()-1)) + else if (aDate == Date(aSysDate-1)) { sMeta = String(SW_RES(STR_POSTIT_YESTERDAY)); } diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx index 7b42514b3c68..ec30d62e1ce6 100644 --- a/sw/source/ui/docvw/srcedtw.cxx +++ b/sw/source/ui/docvw/srcedtw.cxx @@ -538,7 +538,7 @@ IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll) IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) { - Time aSyntaxCheckStart; + Time aSyntaxCheckStart( Time::SYSTEM ); SAL_WARN_IF(pTextView == 0, "sw", "No View yet, but syntax highlighting?!"); bHighlighting = sal_True; @@ -562,7 +562,7 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) nCount++; if(!aSyntaxLineTable.Count()) break; - if((Time().GetTime() - aSyntaxCheckStart.GetTime()) > MAX_HIGHLIGHTTIME ) + if((Time( Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime()) > MAX_HIGHLIGHTTIME ) { pTimer->SetTimeout( 2 * SYNTAX_HIGHLIGHT_TIMEOUT ); break; @@ -580,7 +580,7 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) p = aSyntaxLineTable.Next(); aSyntaxLineTable.Remove(nCurKey); nCount ++; - if(Time().GetTime() - aSyntaxCheckStart.GetTime() > MAX_HIGHLIGHTTIME) + if(Time( Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime() > MAX_HIGHLIGHTTIME) { pTimer->SetTimeout( 2 * SYNTAX_HIGHLIGHT_TIMEOUT ); break; diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index 750b2c03e158..e67d170870be 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -869,7 +869,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData ) case TYP_POSTITFLD: { SwPostItFieldType* pType = (SwPostItFieldType*)pCurShell->GetFldType(0, RES_POSTITFLD); - pFld = new SwPostItField(pType, rData.sPar1, rData.sPar2, DateTime()); + pFld = new SwPostItField(pType, rData.sPar1, rData.sPar2, DateTime( DateTime::SYSTEM )); break; } case TYP_SCRIPTFLD: @@ -1716,12 +1716,12 @@ sal_uLong SwFldMgr::GetDefaultFormat(sal_uInt16 nTypeId, sal_Bool bIsText, SvNum case TYP_TIMEFLD: case TYP_DATEFLD: { - Date aDate; + Date aDate( Date::SYSTEM ); Date* pNullDate = pFormatter->GetNullDate(); fValue = aDate - *pNullDate; - Time aTime; + Time aTime( Time::SYSTEM ); sal_uLong nNumFmtTime = (sal_uLong)aTime.GetSec() + (sal_uLong)aTime.GetMin() * 60L + (sal_uLong)aTime.GetHour() * 3600L; diff --git a/sw/source/ui/inc/gloslst.hxx b/sw/source/ui/inc/gloslst.hxx index 84d9c839cfd4..727191d1b068 100644 --- a/sw/source/ui/inc/gloslst.hxx +++ b/sw/source/ui/inc/gloslst.hxx @@ -46,6 +46,8 @@ struct AutoTextGroup String sLongNames; // by 0x0A seperated long names String sShortNames; // by 0x0A seperated short names DateTime aDateModified; + + AutoTextGroup() : aDateModified( DateTime::EMPTY ) {} }; diff --git a/tools/inc/tools/date.hxx b/tools/inc/tools/date.hxx index e0cb2a25ff39..71cc65f3b4ad 100644 --- a/tools/inc/tools/date.hxx +++ b/tools/inc/tools/date.hxx @@ -50,7 +50,20 @@ private: sal_uInt32 nDate; public: - Date(); + + enum DateInitSystem + { + SYSTEM + }; + // temporary until all uses are inspected and resolved + enum DateInitEmpty + { + EMPTY + }; + + Date( DateInitEmpty) + { nDate = 0; } + Date( DateInitSystem ); Date( const ResId & rResId ); Date( sal_uInt32 _nDate ) { Date::nDate = _nDate; } Date( const Date& rDate ) diff --git a/tools/inc/tools/datetime.hxx b/tools/inc/tools/datetime.hxx index d12a276d0f03..3f3ba3831d84 100644 --- a/tools/inc/tools/datetime.hxx +++ b/tools/inc/tools/datetime.hxx @@ -40,7 +40,19 @@ class TOOLS_DLLPUBLIC DateTime : public Date, public Time { public: - DateTime() : Date(), Time() {} + + enum DateTimeInitSystem + { + SYSTEM + }; + // temporary until all uses are inspected and resolved + enum DateTimeInitEmpty + { + EMPTY + }; + + DateTime( DateTimeInitEmpty ) : Date( Date::EMPTY ), Time( Time::EMPTY ) {} + DateTime( DateTimeInitSystem ) : Date( Date::SYSTEM ), Time( Time::SYSTEM ) {} DateTime( const DateTime& rDateTime ) : Date( rDateTime ), Time( rDateTime ) {} DateTime( const Date& rDate ) : Date( rDate ), Time(0) {} diff --git a/tools/inc/tools/time.hxx b/tools/inc/tools/time.hxx index ff6a7c97b9a7..e71fca848829 100644 --- a/tools/inc/tools/time.hxx +++ b/tools/inc/tools/time.hxx @@ -49,7 +49,20 @@ private: sal_Int32 nTime; public: - Time(); + + enum TimeInitSystem + { + SYSTEM + }; + // temporary until all uses are inspected and resolved + enum TimeInitEmpty + { + EMPTY + }; + + Time( TimeInitEmpty ) + { nTime = 0; } + Time( TimeInitSystem ); Time( const ResId & rResId ); Time( sal_Int32 _nTime ) { Time::nTime = _nTime; } Time( const Time& rTime ); diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx index 5deef5250b24..c9614d2de759 100644 --- a/tools/source/datetime/tdate.cxx +++ b/tools/source/datetime/tdate.cxx @@ -137,7 +137,7 @@ static void DaysToDate( long nDays, // ======================================================================= -Date::Date() +Date::Date( DateInitSystem ) { #if defined WNT SYSTEMTIME aDateTime; diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx index 13f68fb2d4f4..015ab374760c 100644 --- a/tools/source/datetime/ttime.cxx +++ b/tools/source/datetime/ttime.cxx @@ -86,7 +86,7 @@ static Time Sec100ToTime( sal_Int32 nSec100 ) // ======================================================================= -Time::Time() +Time::Time( TimeInitSystem ) { #if defined( WNT ) SYSTEMTIME aDateTime; diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index e0db5949e08e..f5fa071ad15a 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -398,7 +398,7 @@ sal_Bool INetRFC822Message::ParseDateField ( sal_uInt16 nOffset = ParseNumber (aDateField, nIndex); if (nOffset > 0) { - Time aDiff; + Time aDiff( Time::EMPTY ); aDiff.SetHour (nOffset / 100); aDiff.SetMin (nOffset % 100); aDiff.SetSec (0); @@ -418,7 +418,7 @@ sal_Bool INetRFC822Message::ParseDateField ( Time aDelta (0); aDelta.SetTime (aDateField.toInt32() * 100); - DateTime aNow; + DateTime aNow( DateTime::SYSTEM ); aNow += aDelta; aNow.ConvertToUTC(); @@ -1112,7 +1112,7 @@ sal_Bool INetMIMEMessage::EnableAttachChild (INetMessageContainerType eType) { // Generate a unique boundary from current time. sal_Char sTail[16 + 1]; - Time aCurTime; + Time aCurTime( Time::SYSTEM ); sal_uInt64 nThis = reinterpret_cast< sal_uIntPtr >( this ); // we can be on a 64bit architecture nThis = ( ( nThis >> 32 ) ^ nThis ) & SAL_MAX_UINT32; sprintf (sTail, "%08X%08X", diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index 9d5e52680c78..a53c7bf883fd 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -1241,7 +1241,8 @@ static sal_Bool _UCBOpenContentSync( //---------------------------------------------------------------------------- UcbLockBytes::UcbLockBytes( UcbLockBytesHandler* pHandler ) - : m_xInputStream (NULL) + : m_aExpireDate( DateTime::EMPTY ) + , m_xInputStream (NULL) , m_pCommandThread( NULL ) , m_xHandler( pHandler ) , m_nError( ERRCODE_NONE ) diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx index c57aa49007cd..74f70365a3fc 100644 --- a/uui/source/iahndl-ssl.cxx +++ b/uui/source/iahndl-ssl.cxx @@ -118,8 +118,8 @@ getLocalizedDatTimeStr( util::DateTime const & rDateTime ) { rtl::OUString aDateTimeStr; - Date aDate; - Time aTime; + Date aDate( Date::EMPTY ); + Time aTime( Time::EMPTY ); aDate = Date( rDateTime.Day, rDateTime.Month, rDateTime.Year ); aTime = Time( rDateTime.Hours, rDateTime.Minutes, rDateTime.Seconds ); diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx index 21eec2670a09..162ea28919ef 100644 --- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx +++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx @@ -86,8 +86,8 @@ public: static double GetNow() { - Date aDateNow; - Time aTimeNow; + Date aDateNow( Date::SYSTEM ); + Time aTimeNow( Time::SYSTEM ); Date aRefDate( 1,1,1900 ); long nDiffDays = (long)(aDateNow - aRefDate); nDiffDays += 2; // Change VisualBasic: 1.Jan.1900 == 2 diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 8705c6e2815a..0a2952b28903 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -1253,7 +1253,7 @@ static sal_Bool ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFie if ( ( nSepPos == STRING_NOTFOUND ) || ( nSepPos == (aStr.Len()-1) ) ) { bYear = sal_False; - nYear = Date().GetYear(); + nYear = Date( Date::SYSTEM ).GetYear(); } const sal_Unicode* pBuf = aStr.GetBuffer(); @@ -1336,11 +1336,11 @@ sal_Bool DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOut maCorrectedDate = aTempDate; if( !GetErrorHdl().Call( this ) ) { - maCorrectedDate = Date(); + maCorrectedDate = Date( Date::SYSTEM ); return sal_False; } else - maCorrectedDate = Date(); + maCorrectedDate = Date( Date::SYSTEM ); } rOutStr = ImplGetDateAsText( aTempDate, rSettings ); @@ -1635,6 +1635,7 @@ DateFormatter::DateFormatter() : maLastDate( 0 ), maMin( 1, 1, 1900 ), maMax( 31, 12, 2200 ), + maCorrectedDate( Date::SYSTEM ), mbEnforceValidValue( sal_True ) { ImplInit(); @@ -1922,7 +1923,7 @@ Date DateFormatter::GetDate() const if ( maLastDate.GetDate() ) aDate = maLastDate; else if ( !IsEmptyFieldValueEnabled() ) - aDate = Date(); + aDate = Date( Date::SYSTEM ); } else aDate = GetInvalidDate(); @@ -1972,7 +1973,7 @@ sal_Bool DateFormatter::IsEmptyDate() const } else if ( !maLastDate.GetDate() ) { - Date aDate; + Date aDate( Date::EMPTY ); bEmpty = !ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ); } } @@ -2016,7 +2017,7 @@ void DateFormatter::Reformat() if ( maLastDate.GetDate() ) SetDate( maLastDate ); else if ( !IsEmptyFieldValueEnabled() ) - SetDate( Date() ); + SetDate( Date( Date::SYSTEM ) ); else { ImplSetText( ImplGetSVEmptyStr() ); @@ -2665,11 +2666,11 @@ sal_Bool TimeFormatter::ImplTimeReformat( const XubString& rStr, XubString& rOut maCorrectedTime = aTempTime; if ( !GetErrorHdl().Call( this ) ) { - maCorrectedTime = Time(); + maCorrectedTime = Time( Time::SYSTEM ); return sal_False; } else - maCorrectedTime = Time(); + maCorrectedTime = Time( Time::SYSTEM ); } sal_Bool bSecond = sal_False; @@ -2803,6 +2804,7 @@ TimeFormatter::TimeFormatter() : maLastTime( 0, 0 ), maMin( 0, 0 ), maMax( 23, 59, 59, 99 ), + maCorrectedTime( Time::SYSTEM ), mbEnforceValidValue( sal_True ), maFieldTime( 0, 0 ) { diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index fc85eeccc0dc..0d6a1713d121 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -1150,7 +1150,7 @@ namespace xmloff sal_Int32 nRepeatDelay = 0; m_xProps->getPropertyValue( PROPERTY_REPEAT_DELAY ) >>= nRepeatDelay; - Time aTime; + Time aTime( Time::SYSTEM ); aTime.MakeTimeFromMS( nRepeatDelay ); util::Duration aDuration; aDuration.Hours = aTime.GetHour(); diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx index 0ab60d8abf52..7088fb7040e8 100644 --- a/xmloff/source/forms/propertyexport.cxx +++ b/xmloff/source/forms/propertyexport.cxx @@ -595,7 +595,7 @@ namespace xmloff ::com::sun::star::util::DateTime aDateTime; if (_rValue >>= aDate) { - Date aToolsDate; + Date aToolsDate( Date::EMPTY ); ::utl::typeConvert(aDate, aToolsDate); fValue = aToolsDate.GetDate(); } @@ -606,7 +606,7 @@ namespace xmloff } else if (_rValue >>= aDateTime) { - DateTime aToolsDateTime; + DateTime aToolsDateTime( DateTime::EMPTY ); ::utl::typeConvert(aDateTime, aToolsDateTime); // the time part (the digits behind the comma) fValue = ((aDateTime.Hours * 60 + aDateTime.Minutes) * 60 + aDateTime.Seconds) * 100 + aDateTime.HundredthSeconds; diff --git a/xmloff/source/text/txtlists.cxx b/xmloff/source/text/txtlists.cxx index 940aa4a6e6c4..b615933e22a1 100644 --- a/xmloff/source/text/txtlists.cxx +++ b/xmloff/source/text/txtlists.cxx @@ -239,8 +239,8 @@ const ::rtl::OUString& XMLTextListsHelper::GetListStyleOfLastProcessedList() con { // Value of xml:id in element <text:list> has to be a valid ID type (#i92478#) ::rtl::OUString sTmpStr( RTL_CONSTASCII_USTRINGPARAM( "list" ) ); - sal_Int64 n = Time().GetTime(); - n += Date().GetDate(); + sal_Int64 n = Time( Time::SYSTEM ).GetTime(); + n += Date( Date::SYSTEM ).GetDate(); n += rand(); // Value of xml:id in element <text:list> has to be a valid ID type (#i92478#) sTmpStr += ::rtl::OUString::valueOf( n ); diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index de77950687e7..8169fcc834d6 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -175,8 +175,8 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif maIssuedToFI.SetSizePixel( aNewSize ); maIssuedByFI.SetSizePixel( aNewSize ); - DateTime aDateTimeStart; - DateTime aDateTimeEnd; + DateTime aDateTimeStart( DateTime::EMPTY ); + DateTime aDateTimeEnd( DateTime::EMPTY ); utl::typeConvert( xCert->getNotValidBefore(), aDateTimeStart ); utl::typeConvert( xCert->getNotValidAfter(), aDateTimeEnd ); String sText = maValidDateFI.GetText(); @@ -290,7 +290,7 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, Certif aDetails = pairIssuer.second; InsertElement( String( XMLSEC_RES( STR_ISSUER ) ), aLBEntry, aDetails ); - DateTime aDateTime; + DateTime aDateTime( DateTime::EMPTY ); utl::typeConvert( xCert->getNotValidBefore(), aDateTime ); aLBEntry = GetSettings().GetUILocaleDataWrapper().getDate( aDateTime.GetDate() ); aLBEntry += String::CreateFromAscii( " " ); diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 320ba7b812be..153e0228294d 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -469,7 +469,7 @@ IMPL_LINK( DigitalSignaturesDialog, AddButtonHdl, Button*, EMPTYARG ) maSignatureHelper.AddForSigning( nSecurityId, aElements[n], aElements[n], bBinaryMode ); } - maSignatureHelper.SetDateTime( nSecurityId, Date(), Time() ); + maSignatureHelper.SetDateTime( nSecurityId, Date( Date::SYSTEM ), Time( Time::SYSTEM ) ); // We open a signature stream in which the existing and the new //signature is written. ImplGetSignatureInformation (later in this function) will |