From 73d0dfd51caaa4cce8ad195fa2631f3fa00d691c Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 9 May 2015 21:29:49 +0200 Subject: Replace IMPL_STATIC_LINK[_TYPED] with more useful variants Change-Id: I344ba9d22adada82170d45a4cf723af6a286b883 --- svtools/source/contnr/treelistbox.cxx | 6 +++--- svtools/source/control/asynclink.cxx | 14 +++++++------- svtools/source/control/calendar.cxx | 12 ++++++------ svtools/source/control/inettbc.cxx | 24 ++++++++++++------------ svtools/source/hatchwindow/documentcloser.cxx | 3 +-- svtools/source/svrtf/svparser.cxx | 24 ++++++++++++------------ svtools/source/uno/popupwindowcontroller.cxx | 3 +-- 7 files changed, 42 insertions(+), 44 deletions(-) (limited to 'svtools/source') diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index c543c67165bc..616d96b55679 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -1403,14 +1403,14 @@ void SvTreeListBox::RemoveBoxFromDDList_Impl( const SvTreeListBox& rB ) SortLBoxes::get().erase( nVal ); } -IMPL_STATIC_LINK( SvTreeListBox, DragFinishHdl_Impl, sal_Int8*, pAction ) +IMPL_LINK( SvTreeListBox, DragFinishHdl_Impl, sal_Int8*, pAction ) { - sal_uLong nVal = reinterpret_cast(pThis); + sal_uLong nVal = reinterpret_cast(this); std::set &rSortLBoxes = SortLBoxes::get(); std::set::const_iterator it = rSortLBoxes.find(nVal); if( it != rSortLBoxes.end() ) { - pThis->DragFinished( *pAction ); + DragFinished( *pAction ); rSortLBoxes.erase( it ); } return 0; diff --git a/svtools/source/control/asynclink.cxx b/svtools/source/control/asynclink.cxx index 2a86642c9eea..d9d5652502ad 100644 --- a/svtools/source/control/asynclink.cxx +++ b/svtools/source/control/asynclink.cxx @@ -81,17 +81,17 @@ AsynchronLink::~AsynchronLink() delete _pMutex; } -IMPL_STATIC_LINK_TYPED( AsynchronLink, HandleCall_Idle, Idle*, EMPTYARG, void ) +IMPL_LINK_NOARG_TYPED( AsynchronLink, HandleCall_Idle, Idle*, void ) { - if( pThis->_pMutex ) pThis->_pMutex->acquire(); - pThis->_nEventId = 0; - if( pThis->_pMutex ) pThis->_pMutex->release(); - pThis->Call_Impl( pThis->_pArg ); + if( _pMutex ) _pMutex->acquire(); + _nEventId = 0; + if( _pMutex ) _pMutex->release(); + Call_Impl( _pArg ); } -IMPL_STATIC_LINK( AsynchronLink, HandleCall_PostUserEvent, void*, EMPTYARG ) +IMPL_LINK_NOARG( AsynchronLink, HandleCall_PostUserEvent ) { - HandleCall_Idle(pThis, nullptr); + HandleCall_Idle(nullptr); return 0; } diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx index 6e08841f32e3..b435f906a5f3 100644 --- a/svtools/source/control/calendar.cxx +++ b/svtools/source/control/calendar.cxx @@ -1404,15 +1404,15 @@ void Calendar::ImplEndTracking( bool bCancel ) -IMPL_STATIC_LINK_TYPED( Calendar, ScrollHdl, Timer*, EMPTYARG, void ) +IMPL_LINK_NOARG_TYPED( Calendar, ScrollHdl, Timer*, void ) { - bool bPrevIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_PREV) != 0; - bool bNextIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_NEXT) != 0; + bool bPrevIn = (mnDragScrollHitTest & CALENDAR_HITTEST_PREV) != 0; + bool bNextIn = (mnDragScrollHitTest & CALENDAR_HITTEST_NEXT) != 0; if( bNextIn || bPrevIn ) { - pThis->mbScrollDateRange = true; - pThis->ImplScroll( bPrevIn ); - pThis->mbScrollDateRange = false; + mbScrollDateRange = true; + ImplScroll( bPrevIn ); + mbScrollDateRange = false; } } diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 7f95b5d113cc..4977d06419bb 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -106,7 +106,7 @@ class SvtMatchContext_Impl: public salhelper::Thread css::uno::Reference< css::ucb::XCommandProcessor > processor_; sal_Int32 commandId_; - DECL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void* ); + DECL_LINK( Select_Impl, void* ); virtual ~SvtMatchContext_Impl(); virtual void execute() SAL_OVERRIDE; @@ -207,18 +207,18 @@ void SvtMatchContext_Impl::execute( ) // Cancellable does not discard the information gained so far, it // inserts all collected completions into the listbox. -IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, ) +IMPL_LINK_NOARG( SvtMatchContext_Impl, Select_Impl ) { // avoid recursion through cancel button { - osl::MutexGuard g(pThis->mutex_); - if (pThis->stopped_) { + osl::MutexGuard g(mutex_); + if (stopped_) { // Completion was stopped, no display: return 0; } } - SvtURLBox* pBox = pThis->pBox; + SvtURLBox* pBox = this->pBox; pBox->bAutoCompleteMode = true; // did we filter completions which otherwise would have been valid? @@ -228,7 +228,7 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, ) // insert all completed strings into the listbox pBox->Clear(); - for(std::vector::iterator i = pThis->aCompletions.begin(); i != pThis->aCompletions.end(); ++i) + for(std::vector::iterator i = aCompletions.begin(); i != aCompletions.end(); ++i) { OUString sCompletion(*i); @@ -259,19 +259,19 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, ) pBox->InsertEntry( sCompletion ); } - if( !pThis->bNoSelection && !pThis->aCompletions.empty() && !bValidCompletionsFiltered ) + if( !bNoSelection && !aCompletions.empty() && !bValidCompletionsFiltered ) { // select the first one OUString aTmp( pBox->GetEntry(0) ); pBox->SetText( aTmp ); - pBox->SetSelection( Selection( pThis->aText.getLength(), aTmp.getLength() ) ); + pBox->SetSelection( Selection( aText.getLength(), aTmp.getLength() ) ); } // transfer string lists to listbox and forget them - pBox->pImp->aURLs = pThis->aURLs; - pBox->pImp->aCompletions = pThis->aCompletions; - pThis->aURLs.clear(); - pThis->aCompletions.clear(); + pBox->pImp->aURLs = aURLs; + pBox->pImp->aCompletions = aCompletions; + aURLs.clear(); + aCompletions.clear(); // force listbox to resize ( it may be open ) pBox->Resize(); diff --git a/svtools/source/hatchwindow/documentcloser.cxx b/svtools/source/hatchwindow/documentcloser.cxx index 54fe1975acb0..f93a951e4ed0 100644 --- a/svtools/source/hatchwindow/documentcloser.cxx +++ b/svtools/source/hatchwindow/documentcloser.cxx @@ -98,9 +98,8 @@ void MainThreadFrameCloserRequest::Start( MainThreadFrameCloserRequest* pMTReque } -IMPL_STATIC_LINK( MainThreadFrameCloserRequest, worker, MainThreadFrameCloserRequest*, pMTRequest ) +IMPL_STATIC_LINK_NOINSTANCE( MainThreadFrameCloserRequest, worker, MainThreadFrameCloserRequest*, pMTRequest ) { - (void) pThis; // unused if ( pMTRequest ) { if ( pMTRequest->m_xFrame.is() ) diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx index 736e0ef8cf76..370464945c04 100644 --- a/svtools/source/svrtf/svparser.cxx +++ b/svtools/source/svrtf/svparser.cxx @@ -607,30 +607,30 @@ void SvParser::BuildWhichTbl( std::vector &rWhichMap, } -IMPL_STATIC_LINK( SvParser, NewDataRead, void*, EMPTYARG ) +IMPL_LINK_NOARG( SvParser, NewDataRead ) { - switch( pThis->eState ) + switch( eState ) { case SVPAR_PENDING: // if file is loaded we are not allowed to continue // instead should ignore the call. - if( pThis->IsDownloadingFile() ) + if( IsDownloadingFile() ) break; - pThis->eState = SVPAR_WORKING; - pThis->RestoreState(); + eState = SVPAR_WORKING; + RestoreState(); - pThis->Continue( pThis->pImplData->nToken ); + Continue( pImplData->nToken ); - if( ERRCODE_IO_PENDING == pThis->rInput.GetError() ) - pThis->rInput.ResetError(); + if( ERRCODE_IO_PENDING == rInput.GetError() ) + rInput.ResetError(); - if( SVPAR_PENDING != pThis->eState ) - pThis->ReleaseRef(); // ready otherwise! + if( SVPAR_PENDING != eState ) + ReleaseRef(); // ready otherwise! break; case SVPAR_WAITFORDATA: - pThis->eState = SVPAR_WORKING; + eState = SVPAR_WORKING; break; case SVPAR_NOTSTARTED: @@ -638,7 +638,7 @@ IMPL_STATIC_LINK( SvParser, NewDataRead, void*, EMPTYARG ) break; default: - pThis->ReleaseRef(); // ready otherwise! + ReleaseRef(); // ready otherwise! break; } diff --git a/svtools/source/uno/popupwindowcontroller.cxx b/svtools/source/uno/popupwindowcontroller.cxx index b3a63698ee79..7f480680c5a4 100644 --- a/svtools/source/uno/popupwindowcontroller.cxx +++ b/svtools/source/uno/popupwindowcontroller.cxx @@ -123,9 +123,8 @@ IMPL_LINK( PopupWindowControllerImpl, WindowEventListener, VclSimpleEvent*, pEve -IMPL_STATIC_LINK( PopupWindowControllerImpl, AsyncDeleteWindowHdl, vcl::Window*, pWindow ) +IMPL_STATIC_LINK_NOINSTANCE( PopupWindowControllerImpl, AsyncDeleteWindowHdl, vcl::Window*, pWindow ) { - (void)*pThis; pWindow->disposeOnce(); return 0; } -- cgit