summaryrefslogtreecommitdiff
path: root/automation
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2011-12-01 21:03:42 +0100
committerEike Rathke <erack@redhat.com>2011-12-01 21:04:29 +0100
commit86adb5cacb4fe3e7fb869299447da5876f0da30d (patch)
treef7998dd1a12a82ca53a4fa155cdf5536ac25ef62 /automation
parentb20ea84970fb8b3068880a361822941c47f50edd (diff)
get rid of class Date and Time default ctor with system time penalty
Diffstat (limited to 'automation')
-rw-r--r--automation/source/server/profiler.cxx2
-rw-r--r--automation/source/server/profiler.hxx2
-rw-r--r--automation/source/server/sta_list.cxx4
-rw-r--r--automation/source/server/statemnt.cxx32
-rw-r--r--automation/source/simplecm/simplecm.cxx10
-rw-r--r--automation/source/testtool/objtest.cxx4
-rw-r--r--automation/source/testtool/objtest.hxx2
-rw-r--r--automation/source/testtool/tcommuni.cxx5
8 files changed, 35 insertions, 26 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 );