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 --- dbaccess/source/ui/browser/brwctrlr.cxx | 2 +- dbaccess/source/ui/control/dbtreelistbox.cxx | 2 +- dbaccess/source/ui/control/sqledit.cxx | 4 ++-- dbaccess/source/ui/dlg/paramdialog.cxx | 2 +- dbaccess/source/ui/inc/JoinTableView.hxx | 2 +- dbaccess/source/ui/querydesign/JoinTableView.cxx | 4 ++-- dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 2 +- dbaccess/source/ui/querydesign/TableWindowListBox.cxx | 4 ++-- dbaccess/source/ui/tabledesign/TEditControl.cxx | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 08bb04ea36a5..6582b37fad1f 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -552,7 +552,7 @@ SbaXDataBrowserController::SbaXDataBrowserController(const Reference< css::uno:: } osl_atomic_decrement(&m_refCount); - m_aInvalidateClipboard.SetTimeoutHdl(LINK(this, SbaXDataBrowserController, OnInvalidateClipboard)); + m_aInvalidateClipboard.SetInvokeHandler(LINK(this, SbaXDataBrowserController, OnInvalidateClipboard)); m_aInvalidateClipboard.SetTimeout(300); } diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index ccfca86880a6..f191ceee0ba8 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -72,7 +72,7 @@ void DBTreeListBox::init() SetSpaceBetweenEntries(nSize); m_aTimer.SetTimeout(900); - m_aTimer.SetTimeoutHdl(LINK(this, DBTreeListBox, OnTimeOut)); + m_aTimer.SetInvokeHandler(LINK(this, DBTreeListBox, OnTimeOut)); m_aScrollHelper.setUpScrollMethod( LINK(this, DBTreeListBox, ScrollUpHdl) ); m_aScrollHelper.setDownScrollMethod( LINK(this, DBTreeListBox, ScrollDownHdl) ); diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index 810a78a3bb01..fa80d16ce681 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -75,10 +75,10 @@ OSqlEdit::OSqlEdit( OQueryTextView* pParent ) : SetModifyHdl( LINK(this, OSqlEdit, ModifyHdl) ); m_timerUndoActionCreation.SetTimeout(1000); - m_timerUndoActionCreation.SetTimeoutHdl(LINK(this, OSqlEdit, OnUndoActionTimer)); + m_timerUndoActionCreation.SetInvokeHandler(LINK(this, OSqlEdit, OnUndoActionTimer)); m_timerInvalidate.SetTimeout(200); - m_timerInvalidate.SetTimeoutHdl(LINK(this, OSqlEdit, OnInvalidateTimer)); + m_timerInvalidate.SetInvokeHandler(LINK(this, OSqlEdit, OnInvalidateTimer)); m_timerInvalidate.Start(); ImplSetFont(); diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index c240f477b022..636d82e7f146 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -104,7 +104,7 @@ namespace dbaui Construct(); - m_aResetVisitFlag.SetTimeoutHdl(LINK(this, OParameterDialog, OnVisitedTimeout)); + m_aResetVisitFlag.SetInvokeHandler(LINK(this, OParameterDialog, OnVisitedTimeout)); } OParameterDialog::~OParameterDialog() diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx index 03fb8bb71ef4..343f703a4d19 100644 --- a/dbaccess/source/ui/inc/JoinTableView.hxx +++ b/dbaccess/source/ui/inc/JoinTableView.hxx @@ -103,7 +103,7 @@ namespace dbaui bool m_bTrackingInitiallyMoved; - DECL_LINK(OnDragScrollTimer, Idle*, void); + DECL_LINK(OnDragScrollTimer, Timer*, void); protected: VclPtr m_pLastFocusTabWin; diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index 728903252df0..88fe2941e6cd 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -174,7 +174,7 @@ OJoinTableView::OJoinTableView( vcl::Window* pParent, OJoinDesignView* pView ) InitColors(); - m_aDragScrollIdle.SetIdleHdl(LINK(this, OJoinTableView, OnDragScrollTimer)); + m_aDragScrollIdle.SetInvokeHandler(LINK(this, OJoinTableView, OnDragScrollTimer)); } OJoinTableView::~OJoinTableView() @@ -1073,7 +1073,7 @@ void OJoinTableView::ScrollWhileDragging() ShowTracking( m_aDragRect, ShowTrackFlags::Small | ShowTrackFlags::TrackWindow ); } -IMPL_LINK_NOARG(OJoinTableView, OnDragScrollTimer, Idle *, void) +IMPL_LINK_NOARG(OJoinTableView, OnDragScrollTimer, Timer *, void) { ScrollWhileDragging(); } diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 8d421eefe09c..40ac61745126 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -146,7 +146,7 @@ OSelectionBrowseBox::OSelectionBrowseBox( vcl::Window* pParent ) m_bVisibleRow[BROW_FUNCTION_ROW] = false; // first hide m_timerInvalidate.SetTimeout(200); - m_timerInvalidate.SetTimeoutHdl(LINK(this, OSelectionBrowseBox, OnInvalidateTimer)); + m_timerInvalidate.SetInvokeHandler(LINK(this, OSelectionBrowseBox, OnInvalidateTimer)); m_timerInvalidate.Start(); } diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index 0904e805b329..39e005747b9e 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -242,7 +242,7 @@ sal_Int8 OTableWindowListBox::AcceptDrop( const AcceptDropEvent& _rEvt ) { if( !m_aScrollTimer.IsActive() ) { - m_aScrollTimer.SetTimeoutHdl( LINK(this, OTableWindowListBox, ScrollUpHdl) ); + m_aScrollTimer.SetInvokeHandler( LINK(this, OTableWindowListBox, ScrollUpHdl) ); ScrollUpHdl( nullptr ); } } @@ -252,7 +252,7 @@ sal_Int8 OTableWindowListBox::AcceptDrop( const AcceptDropEvent& _rEvt ) { if( !m_aScrollTimer.IsActive() ) { - m_aScrollTimer.SetTimeoutHdl( LINK(this, OTableWindowListBox, ScrollDownHdl) ); + m_aScrollTimer.SetInvokeHandler( LINK(this, OTableWindowListBox, ScrollDownHdl) ); ScrollDownHdl( nullptr ); } } diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 23e0bd942c30..80519ed295da 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -78,7 +78,7 @@ OTableEditorCtrl::ClipboardInvalidator::ClipboardInvalidator(OTableEditorCtrl* _ { m_aInvalidateTimer.SetTimeout(500); - m_aInvalidateTimer.SetTimeoutHdl(LINK(this, OTableEditorCtrl::ClipboardInvalidator, OnInvalidate)); + m_aInvalidateTimer.SetInvokeHandler(LINK(this, OTableEditorCtrl::ClipboardInvalidator, OnInvalidate)); m_aInvalidateTimer.Start(); } -- cgit