diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2016-09-14 13:48:02 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-01-17 16:22:57 +0100 |
commit | 59b84bc78dff2adb265d9fa8edb4c42794cf9771 (patch) | |
tree | 929a0dd7e3d16dfc9d49dac3470fd11546819504 /vcl/source/app/timer.cxx | |
parent | 1531152eff8061d63be5d98641fcafaa1da05167 (diff) |
Change Idle to be a Timer subclass
Drops a lot of duplicated code, as Idle is just a convenience
class for instant, mostly low priority timers.
Change-Id: I847592e92e86d15ab1cab168bf0e667322e48048
Diffstat (limited to 'vcl/source/app/timer.cxx')
-rw-r--r-- | vcl/source/app/timer.cxx | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/vcl/source/app/timer.cxx b/vcl/source/app/timer.cxx index 96485ae90ebd..77704db3835b 100644 --- a/vcl/source/app/timer.cxx +++ b/vcl/source/app/timer.cxx @@ -53,25 +53,22 @@ sal_uInt64 Timer::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTimeNow ) } } -Timer::Timer(const sal_Char *pDebugName) : - Task(pDebugName), - mnTimeout(Scheduler::ImmediateTimeoutMs), - mbAuto(false) +Timer::Timer(const sal_Char *pDebugName) + : Task( pDebugName ) + , mnTimeout( Scheduler::ImmediateTimeoutMs ) + , mbAuto( false ) { mePriority = TaskPriority::HIGHEST; } -Timer::Timer( const Timer& rTimer ) : - Task(rTimer), - mnTimeout(rTimer.mnTimeout), - mbAuto(rTimer.mbAuto) +void Timer::Invoke() { - maTimeoutHdl = rTimer.maTimeoutHdl; + maInvokeHandler.Call( this ); } -void Timer::Invoke() +void Timer::Invoke( Timer *arg ) { - maTimeoutHdl.Call( this ); + maInvokeHandler.Call( arg ); } void Timer::Start() @@ -88,29 +85,10 @@ void Timer::SetTimeout( sal_uInt64 nNewTimeout ) StartTimer( mnTimeout ); } -Timer& Timer::operator=( const Timer& rTimer ) -{ - Task::operator=(rTimer); - maTimeoutHdl = rTimer.maTimeoutHdl; - mnTimeout = rTimer.mnTimeout; - mbAuto = rTimer.mbAuto; - return *this; -} - AutoTimer::AutoTimer( const sal_Char *pDebugName ) : Timer( pDebugName ) { mbAuto = true; } -AutoTimer::AutoTimer( const AutoTimer& rTimer ) : Timer( rTimer ) -{ - mbAuto = true; -} - -AutoTimer& AutoTimer::operator=( const AutoTimer& rTimer ) -{ - Timer::operator=( rTimer ); - return *this; -} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |