diff options
author | Eike Rathke <erack@redhat.com> | 2011-12-01 21:03:42 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2011-12-01 21:04:29 +0100 |
commit | 86adb5cacb4fe3e7fb869299447da5876f0da30d (patch) | |
tree | f7998dd1a12a82ca53a4fa155cdf5536ac25ef62 /automation/source/server | |
parent | b20ea84970fb8b3068880a361822941c47f50edd (diff) |
get rid of class Date and Time default ctor with system time penalty
Diffstat (limited to 'automation/source/server')
-rw-r--r-- | automation/source/server/profiler.cxx | 2 | ||||
-rw-r--r-- | automation/source/server/profiler.hxx | 2 | ||||
-rw-r--r-- | automation/source/server/sta_list.cxx | 4 | ||||
-rw-r--r-- | automation/source/server/statemnt.cxx | 32 |
4 files changed, 22 insertions, 18 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; |