From b35820c000788eba3c50aa659f4174d2f613586d Mon Sep 17 00:00:00 2001 From: Tobias Madl Date: Fri, 21 Nov 2014 08:12:11 +0000 Subject: changed timers to idles Change-Id: Iac97f482df9fca8563e6931e4c710c1cc4e6503d --- sd/inc/drawdoc.hxx | 2 +- sd/source/core/drawdoc.cxx | 2 +- sd/source/core/drawdoc4.cxx | 18 +++++++++--------- sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx | 18 +++++++++--------- sd/source/ui/slidesorter/cache/SlsQueueProcessor.hxx | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) (limited to 'sd') diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx index 6cd99ce335cf..524dcba959ce 100644 --- a/sd/inc/drawdoc.hxx +++ b/sd/inc/drawdoc.hxx @@ -149,7 +149,7 @@ private: ::sd::Outliner* mpOutliner; ///< local outliner for outline mode ::sd::Outliner* mpInternalOutliner; ///< internal outliner for creation of text objects Timer* mpWorkStartupTimer; - Timer* mpOnlineSpellingTimer; + Idle* mpOnlineSpellingIdle; sd::ShapeList* mpOnlineSpellingList; SvxSearchItem* mpOnlineSearchItem; std::vector maFrameViewList; diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index f18436c45c89..9e5a422b08b2 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -152,7 +152,7 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh) , mpOutliner(NULL) , mpInternalOutliner(NULL) , mpWorkStartupTimer(NULL) -, mpOnlineSpellingTimer(NULL) +, mpOnlineSpellingIdle(NULL) , mpOnlineSpellingList(NULL) , mpOnlineSearchItem(NULL) , mpCustomShowList(NULL) diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 8b1848f64978..6789ad278c87 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -725,13 +725,13 @@ sal_uInt16 SdDrawDocument::GetMasterPageUserCount(SdrPage* pMaster) const void SdDrawDocument::StopOnlineSpelling() { - if (mpOnlineSpellingTimer && mpOnlineSpellingTimer->IsActive()) + if (mpOnlineSpellingIdle && mpOnlineSpellingIdle->IsActive()) { - mpOnlineSpellingTimer->Stop(); + mpOnlineSpellingIdle->Stop(); } - delete mpOnlineSpellingTimer; - mpOnlineSpellingTimer = NULL; + delete mpOnlineSpellingIdle; + mpOnlineSpellingIdle = NULL; delete mpOnlineSpellingList; mpOnlineSpellingList = NULL; @@ -773,10 +773,10 @@ void SdDrawDocument::StartOnlineSpelling(bool bForceSpelling) } mpOnlineSpellingList->seekShape(0); - mpOnlineSpellingTimer = new Timer(); - mpOnlineSpellingTimer->SetTimeoutHdl( LINK(this, SdDrawDocument, OnlineSpellingHdl) ); - mpOnlineSpellingTimer->SetTimeout(250); - mpOnlineSpellingTimer->Start(); + mpOnlineSpellingIdle = new Idle(); + mpOnlineSpellingIdle->SetIdleHdl( LINK(this, SdDrawDocument, OnlineSpellingHdl) ); + mpOnlineSpellingIdle->SetPriority(VCL_IDLE_PRIORITY_LOWEST); + mpOnlineSpellingIdle->Start(); } } @@ -861,7 +861,7 @@ IMPL_LINK_NOARG(SdDrawDocument, OnlineSpellingHdl) } // Continue search - mpOnlineSpellingTimer->Start(); + mpOnlineSpellingIdle->Start(); } else { diff --git a/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx b/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx index cc6c78865427..1364bee980e5 100644 --- a/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx +++ b/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx @@ -32,7 +32,7 @@ QueueProcessor::QueueProcessor ( const bool bDoSuperSampling, const SharedCacheContext& rpCacheContext) : maMutex(), - maTimer(), + maIdle(), mnTimeBetweenHighPriorityRequests (10/*ms*/), mnTimeBetweenLowPriorityRequests (100/*ms*/), mnTimeBetweenRequestsWhenNotIdle (1000/*ms*/), @@ -58,8 +58,8 @@ QueueProcessor::QueueProcessor ( if (aTimeBetweenReqeusts.has()) aTimeBetweenReqeusts >>= mnTimeBetweenRequestsWhenNotIdle; - maTimer.SetTimeoutHdl (LINK(this,QueueProcessor,ProcessRequestHdl)); - maTimer.SetTimeout (mnTimeBetweenHighPriorityRequests); + maIdle.SetIdleHdl (LINK(this,QueueProcessor,ProcessRequestHdl)); + maIdle.SetPriority (VCL_IDLE_PRIORITY_REPAINT); } QueueProcessor::~QueueProcessor (void) @@ -70,20 +70,20 @@ void QueueProcessor::Start (int nPriorityClass) { if (mbIsPaused) return; - if ( ! maTimer.IsActive()) + if ( ! maIdle.IsActive()) { if (nPriorityClass == 0) - maTimer.SetTimeout (mnTimeBetweenHighPriorityRequests); + maIdle.SetPriority (VCL_IDLE_PRIORITY_REPAINT); else - maTimer.SetTimeout (mnTimeBetweenLowPriorityRequests); - maTimer.Start(); + maIdle.SetPriority (VCL_IDLE_PRIORITY_LOW); + maIdle.Start(); } } void QueueProcessor::Stop (void) { - if (maTimer.IsActive()) - maTimer.Stop(); + if (maIdle.IsActive()) + maIdle.Stop(); } void QueueProcessor::Pause (void) diff --git a/sd/source/ui/slidesorter/cache/SlsQueueProcessor.hxx b/sd/source/ui/slidesorter/cache/SlsQueueProcessor.hxx index 1e34261caa61..6993d5cdbf3c 100644 --- a/sd/source/ui/slidesorter/cache/SlsQueueProcessor.hxx +++ b/sd/source/ui/slidesorter/cache/SlsQueueProcessor.hxx @@ -92,7 +92,7 @@ private: */ ::osl::Mutex maMutex; - Timer maTimer; + Idle maIdle; DECL_LINK(ProcessRequestHdl, void *); sal_uInt32 mnTimeBetweenHighPriorityRequests; sal_uInt32 mnTimeBetweenLowPriorityRequests; -- cgit v1.2.3