summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-09-28 15:49:26 +0200
committerNoel Grandin <noelgrandin@gmail.com>2014-10-01 07:34:23 +0000
commitfc04f76336fdf8c96e35382cdeb497e2f939705c (patch)
tree70c9bbd054a34a9bca9d22bb7afbb9c4349beff0 /basic
parenteb4811590c85895ce531674596bdd6afb3397725 (diff)
fdo#82577: Handle Time
Put the TOOLS Time class in the tools namespace. Avoids clash with the X11 Time typedef. Change-Id: Iac57d5aef35e81ace1ee0d5e6d76cb278f8ad866 Reviewed-on: https://gerrit.libreoffice.org/11684 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/comp/sbcomp.cxx6
-rw-r--r--basic/source/runtime/methods.cxx18
-rw-r--r--basic/source/runtime/methods1.cxx2
-rw-r--r--basic/source/sbx/sbxdate.cxx2
4 files changed, 14 insertions, 14 deletions
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx
index 7e79bef3c337..8bb671841749 100644
--- a/basic/source/comp/sbcomp.cxx
+++ b/basic/source/comp/sbcomp.cxx
@@ -382,7 +382,7 @@ void lcl_printTimeOutput( void )
{
// Overall time output
lcl_lineOut( "" );
- lcl_lineOut( "***** Time Output *****" );
+ lcl_lineOut( "***** tools::Time Output *****" );
char TimeBuffer[500];
double dTotalTime = GpTimer->getElapsedTime() - GdStartTime;
sprintf( TimeBuffer, "Total execution time = %f ms", dTotalTime*1000.0 );
@@ -606,7 +606,7 @@ void dbg_traceStep( SbModule* pModule, sal_uInt32 nPC, sal_Int32 nCallLvl )
{
double dDiffTime = dCurTime - GdLastTime;
GdLastTime = dCurTime;
- sprintf( TimeBuffer, "\t\t// Time = %f ms / += %f ms", dCurTime*1000.0, dDiffTime*1000.0 );
+ sprintf( TimeBuffer, "\t\t// tools::Time = %f ms / += %f ms", dCurTime*1000.0, dDiffTime*1000.0 );
}
#endif
@@ -802,7 +802,7 @@ void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, sal_Int32 nCallL
char TimeBuffer[200];
if( GbTimerOn && bLeave )
{
- sprintf( TimeBuffer, " // Execution Time = %f ms", dExecutionTime*1000.0 );
+ sprintf( TimeBuffer, " // Execution tools::Time = %f ms", dExecutionTime*1000.0 );
pPostStr = TimeBuffer;
}
#endif
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 0d8ff6426158..53880946bde8 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -2360,7 +2360,7 @@ RTLFUNC(Second)
double Now_Impl()
{
Date aDate( Date::SYSTEM );
- Time aTime( Time::SYSTEM );
+ tools::Time aTime( tools::Time::SYSTEM );
double aSerial = (double)GetDayDiff( aDate );
long nSeconds = aTime.GetHour();
nSeconds *= 3600;
@@ -2388,7 +2388,7 @@ RTLFUNC(Time)
if ( !bWrite )
{
- Time aTime( Time::SYSTEM );
+ tools::Time aTime( tools::Time::SYSTEM );
SbxVariable* pMeth = rPar.Get( 0 );
OUString aRes;
if( pMeth->IsFixed() )
@@ -2442,7 +2442,7 @@ RTLFUNC(Timer)
(void)pBasic;
(void)bWrite;
- Time aTime( Time::SYSTEM );
+ tools::Time aTime( tools::Time::SYSTEM );
long nSeconds = aTime.GetHour();
nSeconds *= 3600;
nSeconds += aTime.GetMin() * 60;
@@ -3212,7 +3212,7 @@ RTLFUNC(FileDateTime)
else
{
OUString aPath = rPar.Get(1)->GetOUString();
- Time aTime( Time::EMPTY );
+ tools::Time aTime( tools::Time::EMPTY );
Date aDate( Date::EMPTY );
if( hasUno() )
{
@@ -3222,7 +3222,7 @@ RTLFUNC(FileDateTime)
try
{
util::DateTime aUnoDT = xSFI->getDateTimeModified( aPath );
- aTime = Time( aUnoDT.Hours, aUnoDT.Minutes, aUnoDT.Seconds, aUnoDT.NanoSeconds );
+ aTime = tools::Time( aUnoDT.Hours, aUnoDT.Minutes, aUnoDT.Seconds, aUnoDT.NanoSeconds );
aDate = Date( aUnoDT.Day, aUnoDT.Month, aUnoDT.Year );
}
catch(const Exception & )
@@ -3241,7 +3241,7 @@ RTLFUNC(FileDateTime)
oslDateTime aDT;
osl_getDateTimeFromTimeValue( &aTimeVal, &aDT );
- aTime = Time( aDT.Hours, aDT.Minutes, aDT.Seconds, aDT.NanoSeconds );
+ aTime = tools::Time( aDT.Hours, aDT.Minutes, aDT.Seconds, aDT.NanoSeconds );
aDate = Date( aDT.Day, aDT.Month, aDT.Year );
}
@@ -4954,11 +4954,11 @@ bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, double&
double implTimeSerial( sal_Int16 nHours, sal_Int16 nMinutes, sal_Int16 nSeconds )
{
return
- static_cast<double>( nHours * ::Time::secondPerHour +
- nMinutes * ::Time::secondPerMinute +
+ static_cast<double>( nHours * ::tools::Time::secondPerHour +
+ nMinutes * ::tools::Time::secondPerMinute +
nSeconds)
/
- static_cast<double>( ::Time::secondPerDay );
+ static_cast<double>( ::tools::Time::secondPerDay );
}
bool implDateTimeSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay,
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 81ad39c62bbc..43b4d01858f2 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -1412,7 +1412,7 @@ RTLFUNC(GetSystemTicks)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- rPar.Get(0)->PutLong( Time::GetSystemTicks() );
+ rPar.Get(0)->PutLong( tools::Time::GetSystemTicks() );
}
RTLFUNC(GetPathSeparator)
diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx
index 5f0bcca909fc..b2f5be0f6d97 100644
--- a/basic/source/sbx/sbxdate.cxx
+++ b/basic/source/sbx/sbxdate.cxx
@@ -280,7 +280,7 @@ start:
// if the whole-number part is 0, we want no year!
if( n <= -1.0 || n >= 1.0 )
{
- // Time only if != 00:00:00
+ // tools::Time only if != 00:00:00
if( floor( n ) == n )
{
switch( eDate )