From 78b124143a3c2bd82984c1c06aa3265c211cef13 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 8 Sep 2015 12:45:38 +0200 Subject: convert Link<> to typed Change-Id: I2f36a123662488ef5534f7bf0845d61e497fb0ec --- vcl/source/window/accel.cxx | 9 ++------- vcl/source/window/accmgr.cxx | 17 ++++------------- vcl/source/window/toolbox.cxx | 8 +++----- 3 files changed, 9 insertions(+), 25 deletions(-) (limited to 'vcl/source') diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index 6905142f0b9d..75ea7bc7b731 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -300,17 +300,12 @@ Accelerator::~Accelerator() void Accelerator::Activate() { - maActivateHdl.Call( this ); -} - -void Accelerator::Deactivate() -{ - maDeactivateHdl.Call( this ); + maActivateHdl.Call( *this ); } void Accelerator::Select() { - maSelectHdl.Call( this ); + maSelectHdl.Call( *this ); } void Accelerator::InsertItem( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode ) diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx index 5bc762739c40..e855193ca7a2 100644 --- a/vcl/source/window/accmgr.cxx +++ b/vcl/source/window/accmgr.cxx @@ -60,7 +60,7 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel ) Accelerator* pSubAccel = pAccel->GetAccel( pAccel->GetItemId(i) ); for ( size_t j = 0, n = mpSequenceList->size(); j < n; ++j ) { if ( (*mpSequenceList)[ j ] == pSubAccel ) { - EndSequence( true ); + EndSequence(); i = pAccel->GetItemCount(); break; } @@ -80,25 +80,17 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel ) } } -void ImplAccelManager::EndSequence( bool bCancel ) +void ImplAccelManager::EndSequence() { // are we in a list ? if ( !mpSequenceList ) return; - // call all deactivate-handler of the accelerators in the list for ( size_t i = 0, n = mpSequenceList->size(); i < n; ++i ) { Accelerator* pTempAccel = (*mpSequenceList)[ i ]; - bool bDel = false; - pTempAccel->mbIsCancel = bCancel; - pTempAccel->mpDel = &bDel; - pTempAccel->Deactivate(); - if ( !bDel ) - { - pTempAccel->mbIsCancel = false; - pTempAccel->mpDel = NULL; - } + pTempAccel->mbIsCancel = false; + pTempAccel->mpDel = NULL; } // delete sequence-list @@ -222,7 +214,6 @@ bool ImplAccelManager::IsAccelKey( const vcl::KeyCode& rKeyCode, sal_uInt16 nRep { // first call activate/deactivate-Handler pAccel->Activate(); - pAccel->Deactivate(); // define accelerator of the actual item // and call the handler diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 5e75a1548903..f6cf52536eb7 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -129,7 +129,7 @@ public: void EndDragging( bool bOK = true ); void HideDragRect() { if ( mbShowDragRect ) mpDragBox->HideTracking(); } void UpdateDragRect(); - DECL_LINK( SelectHdl, Accelerator* ); + DECL_LINK_TYPED( SelectHdl, Accelerator&, void ); }; static ImplTBDragMgr* ImplGetTBDragMgr() @@ -1336,14 +1336,12 @@ void ImplTBDragMgr::UpdateDragRect() mpDragBox->ShowTracking( maRect ); } -IMPL_LINK( ImplTBDragMgr, SelectHdl, Accelerator*, pAccel ) +IMPL_LINK_TYPED( ImplTBDragMgr, SelectHdl, Accelerator&, rAccel, void ) { - if ( pAccel->GetCurItemId() == KEY_ESCAPE ) + if ( rAccel.GetCurItemId() == KEY_ESCAPE ) EndDragging( false ); else EndDragging(); - - return (long) true; } void ToolBox::ImplInit( vcl::Window* pParent, WinBits nStyle ) -- cgit