From bf110d40efcc79efb9247fdce5d2f54bafa6550b Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Mon, 23 Jan 2017 19:37:51 +0100 Subject: Change all Idle* LINKs to be Timer* Seem UBSAN doesn't like my forced reinterpret_cast to set the Idles Link in the Timer class. Now there are two possible solution: 1. convert all (DECL|IMPL).*_LINK call sites to use a Timer* or 2. split the inheritance of Idle from Timer again to maintain different Link<>s and move all common code into a TimerBase. While the 1st is more correct, the 2nd has a better indicator for Idles. This implements the first solution. And while at it, this also converts all call sites of SetTimeoutHdl and SetIdleHdl to SetInvokeHandler and gets rid of some local Link objects, which are just passed to the SetInvokeHandler call. It also introduces ClearInvokeHandler() and replaces the respective call sites of SetInvokeHandler( Link() ). Change-Id: I40c4167b1493997b7f136add4dad2f4ff5504b69 --- sc/source/ui/docshell/autostyl.cxx | 6 +++--- sc/source/ui/docshell/datastream.cxx | 2 +- sc/source/ui/docshell/externalrefmgr.cxx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'sc/source/ui/docshell') diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx index 355d5b7851df..68cae217c652 100644 --- a/sc/source/ui/docshell/autostyl.cxx +++ b/sc/source/ui/docshell/autostyl.cxx @@ -63,8 +63,8 @@ ScAutoStyleList::ScAutoStyleList(ScDocShell* pShell) , aInitIdle("ScAutoStyleList InitIdle") , nTimerStart(0) { - aTimer.SetTimeoutHdl( LINK( this, ScAutoStyleList, TimerHdl ) ); - aInitIdle.SetIdleHdl( LINK( this, ScAutoStyleList, InitHdl ) ); + aTimer.SetInvokeHandler( LINK( this, ScAutoStyleList, TimerHdl ) ); + aInitIdle.SetInvokeHandler( LINK( this, ScAutoStyleList, InitHdl ) ); aInitIdle.SetPriority( TaskPriority::HIGHEST ); } @@ -81,7 +81,7 @@ void ScAutoStyleList::AddInitial( const ScRange& rRange, const OUString& rStyle1 aInitIdle.Start(); } -IMPL_LINK_NOARG(ScAutoStyleList, InitHdl, Idle *, void) +IMPL_LINK_NOARG(ScAutoStyleList, InitHdl, Timer *, void) { std::vector::iterator iter; for (iter = aInitials.begin(); iter != aInitials.end(); ++iter) diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx index 367b73c2a842..d42382478a7b 100644 --- a/sc/source/ui/docshell/datastream.cxx +++ b/sc/source/ui/docshell/datastream.cxx @@ -317,7 +317,7 @@ DataStream::DataStream(ScDocShell *pShell, const OUString& rURL, const ScRange& mbIsUpdate(false) { maImportTimer.SetTimeout(0); - maImportTimer.SetTimeoutHdl( LINK(this, DataStream, ImportTimerHdl) ); + maImportTimer.SetInvokeHandler( LINK(this, DataStream, ImportTimerHdl) ); Decode(rURL, rRange, nLimit, eMove, nSettings); } diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 42c17b937db9..94b8752f429e 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -1681,7 +1681,7 @@ ScExternalRefManager::ScExternalRefManager(ScDocument* pDoc) : mbUserInteractionEnabled(true), mbDocTimerEnabled(true) { - maSrcDocTimer.SetTimeoutHdl( LINK(this, ScExternalRefManager, TimeOutHdl) ); + maSrcDocTimer.SetInvokeHandler( LINK(this, ScExternalRefManager, TimeOutHdl) ); maSrcDocTimer.SetTimeout(SRCDOC_SCAN_INTERVAL); maSrcDocTimer.SetDebugName( "sc::ScExternalRefManager maSrcDocTimer" ); } -- cgit