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 --- basctl/source/basicide/baside2.hxx | 2 +- basctl/source/basicide/baside2b.cxx | 4 ++-- basctl/source/dlged/dlged.cxx | 4 ++-- basctl/source/dlged/dlgedfunc.cxx | 2 +- basctl/source/inc/dlged.hxx | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'basctl/source') diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx index d1799d116fae..eac82321f975 100644 --- a/basctl/source/basicide/baside2.hxx +++ b/basctl/source/basicide/baside2.hxx @@ -88,7 +88,7 @@ private: SyntaxHighlighter aHighlighter; Idle aSyntaxIdle; std::set aSyntaxLineTable; - DECL_LINK(SyntaxTimerHdl, Idle *, void); + DECL_LINK(SyntaxTimerHdl, Timer *, void); // progress bar class ProgressInfo; diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index a7d88ef8c3fd..bd0b4cff2249 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -961,7 +961,7 @@ void EditorWindow::CreateEditEngine() ImplSetFont(); aSyntaxIdle.SetPriority( TaskPriority::LOWER ); - aSyntaxIdle.SetIdleHdl( LINK( this, EditorWindow, SyntaxTimerHdl ) ); + aSyntaxIdle.SetInvokeHandler( LINK( this, EditorWindow, SyntaxTimerHdl ) ); bool bWasDoSyntaxHighlight = bDoSyntaxHighlight; bDoSyntaxHighlight = false; // too slow for large texts... @@ -1253,7 +1253,7 @@ void EditorWindow::DoDelayedSyntaxHighlight( sal_uLong nPara ) } } -IMPL_LINK_NOARG(EditorWindow, SyntaxTimerHdl, Idle *, void) +IMPL_LINK_NOARG(EditorWindow, SyntaxTimerHdl, Timer *, void) { DBG_ASSERT( pEditView, "Noch keine View, aber Syntax-Highlight ?!" ); diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index cc0aa7fcb755..052506d61ef4 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -218,7 +218,7 @@ DlgEditor::DlgEditor ( m_ClipboardDataFlavorsResource[1].DataType = cppu::UnoType>::get(); aMarkIdle.SetPriority(TaskPriority::LOW); - aMarkIdle.SetIdleHdl( LINK( this, DlgEditor, MarkTimeout ) ); + aMarkIdle.SetInvokeHandler( LINK( this, DlgEditor, MarkTimeout ) ); rWindow.SetMapMode( MapMode( MapUnit::Map100thMM ) ); pDlgEdPage->SetSize( rWindow.PixelToLogic( Size(DLGED_PAGE_WIDTH_MIN, DLGED_PAGE_HEIGHT_MIN) ) ); @@ -574,7 +574,7 @@ void DlgEditor::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect } -IMPL_LINK_NOARG(DlgEditor, MarkTimeout, Idle *, void) +IMPL_LINK_NOARG(DlgEditor, MarkTimeout, Timer *, void) { rLayout.UpdatePropertyBrowser(); } diff --git a/basctl/source/dlged/dlgedfunc.cxx b/basctl/source/dlged/dlgedfunc.cxx index 2ace04cf7350..52b5434bb020 100644 --- a/basctl/source/dlged/dlgedfunc.cxx +++ b/basctl/source/dlged/dlgedfunc.cxx @@ -80,7 +80,7 @@ void DlgEdFunc::ForceScroll( const Point& rPos ) DlgEdFunc::DlgEdFunc (DlgEditor& rParent_) : rParent(rParent_) { - aScrollTimer.SetTimeoutHdl( LINK( this, DlgEdFunc, ScrollTimeout ) ); + aScrollTimer.SetInvokeHandler( LINK( this, DlgEdFunc, ScrollTimeout ) ); aScrollTimer.SetTimeout( SELENG_AUTOREPEAT_INTERVAL ); } diff --git a/basctl/source/inc/dlged.hxx b/basctl/source/inc/dlged.hxx index d4af255a843c..5e2e73bb781d 100644 --- a/basctl/source/inc/dlged.hxx +++ b/basctl/source/inc/dlged.hxx @@ -102,7 +102,7 @@ public: }; private: - DECL_LINK(MarkTimeout, Idle *, void); + DECL_LINK(MarkTimeout, Timer *, void); static void Print( Printer* pPrinter, const OUString& rTitle ); -- cgit