diff options
author | Noel Grandin <noel@peralex.com> | 2015-08-19 09:11:34 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-08-26 11:15:35 +0200 |
commit | 167bc621ef825ed5b961502fe9324a675ee34e42 (patch) | |
tree | 523838d8adc14a62f846529ee6eab3343b2fe87b /fpicker | |
parent | 46a27805fb707544a844a961a3743b8b992282f0 (diff) |
Convert vcl Button Link<> click handler to typed Link<Button*,void>
Change-Id: Ie80dfb003118d40741549c41ebcc7eda4819f05b
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/office/PlacesListBox.cxx | 4 | ||||
-rw-r--r-- | fpicker/source/office/PlacesListBox.hxx | 4 | ||||
-rw-r--r-- | fpicker/source/office/QueryFolderName.hxx | 2 | ||||
-rw-r--r-- | fpicker/source/office/RemoteFilesDialog.cxx | 20 | ||||
-rw-r--r-- | fpicker/source/office/RemoteFilesDialog.hxx | 8 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.cxx | 40 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.hxx | 19 |
7 files changed, 41 insertions, 56 deletions
diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx index 5b6d33416f85..6d5f8c7479a2 100644 --- a/fpicker/source/office/PlacesListBox.cxx +++ b/fpicker/source/office/PlacesListBox.cxx @@ -140,12 +140,12 @@ void PlacesListBox::RemoveSelectedPlace() { RemovePlace(mpImpl->GetCurrRow()); } -void PlacesListBox::SetAddHdl( const Link<>& rHdl ) +void PlacesListBox::SetAddHdl( const Link<Button*,void>& rHdl ) { mpAddBtn->SetClickHdl( rHdl ); } -void PlacesListBox::SetDelHdl( const Link<>& rHdl ) +void PlacesListBox::SetDelHdl( const Link<Button*,void>& rHdl ) { mpDelBtn->SetClickHdl( rHdl ); } diff --git a/fpicker/source/office/PlacesListBox.hxx b/fpicker/source/office/PlacesListBox.hxx index 0d2a4742a958..a3f6c0c620ce 100644 --- a/fpicker/source/office/PlacesListBox.hxx +++ b/fpicker/source/office/PlacesListBox.hxx @@ -60,8 +60,8 @@ class PlacesListBox : public Control bool IsUpdated(); const std::vector<PlacePtr>& GetPlaces() { return maPlaces;} - void SetAddHdl( const Link<>& rHdl ); - void SetDelHdl( const Link<>& rHdl ); + void SetAddHdl( const Link<Button*,void>& rHdl ); + void SetDelHdl( const Link<Button*,void>& rHdl ); void SetDelEnabled( bool enabled ); void SetSizePixel( const Size& rNewSize ) SAL_OVERRIDE; void updateView( ); diff --git a/fpicker/source/office/QueryFolderName.hxx b/fpicker/source/office/QueryFolderName.hxx index cf864aff88ef..d448f354b3a1 100644 --- a/fpicker/source/office/QueryFolderName.hxx +++ b/fpicker/source/office/QueryFolderName.hxx @@ -32,7 +32,7 @@ private: VclPtr<VclFrame> m_pNameLine; VclPtr<OKButton> m_pOKBtn; - DECL_LINK( OKHdl, void * ); + DECL_LINK_TYPED( OKHdl, Button*, void ); DECL_LINK( NameHdl, void * ); public: diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 7f2600d8a64e..c0f3a491d786 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -671,7 +671,7 @@ void RemoteFilesDialog::SavePassword( const OUString& rURL, const OUString& rUse {} } -IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl ) +IMPL_LINK_NOARG_TYPED ( RemoteFilesDialog, AddServiceHdl, Button*, void ) { ScopedVclPtrInstance< PlaceEditDialog > aDlg( this ); aDlg->ShowPasswordControl(); @@ -711,8 +711,6 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl ) // Do Nothing break; }; - - return 1; } IMPL_LINK_NOARG ( RemoteFilesDialog, SelectServiceHdl ) @@ -982,7 +980,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, SelectBreadcrumbHdl, Breadcrumb*, pPtr, voi OpenURL( pPtr->GetHdlURL() ); } -IMPL_LINK_NOARG ( RemoteFilesDialog, NewFolderHdl ) +IMPL_LINK_NOARG_TYPED ( RemoteFilesDialog, NewFolderHdl, Button*, void ) { m_pFileView->EndInplaceEditing( false ); @@ -1006,11 +1004,9 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, NewFolderHdl ) else bHandled = true; } - - return 1; } -IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) +IMPL_LINK_NOARG_TYPED ( RemoteFilesDialog, OkHdl, Button*, void ) { OUString sNameNoExt = m_pName_ed->GetText(); OUString sPathNoExt; @@ -1067,7 +1063,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) sMsg = sMsg.replaceFirst( "$filename$", sName ); ScopedVclPtrInstance< MessageDialog > aBox( this, sMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO ); if( aBox->Execute() != RET_YES ) - return 0; + return; } } else @@ -1077,18 +1073,17 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) OpenURL( sPathNoExt ); m_pName_ed->SetText( "" ); - return 0; + return; } if( m_eMode == REMOTEDLG_MODE_OPEN ) - return 0; + return; } EndDialog( RET_OK ); - return 1; } -IMPL_LINK_NOARG ( RemoteFilesDialog, CancelHdl ) +IMPL_LINK_NOARG_TYPED ( RemoteFilesDialog, CancelHdl, Button*, void ) { if( m_pCurrentAsyncAction.is() ) { @@ -1099,7 +1094,6 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, CancelHdl ) { EndDialog(); } - return 1; } // SvtFileDialog_Base diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index 223ba5bcf55e..4fef385593cd 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -180,7 +180,7 @@ private: void SavePassword( const OUString& rURL, const OUString& rUser, const OUString& rPassword ); - DECL_LINK ( AddServiceHdl, void * ); + DECL_LINK_TYPED ( AddServiceHdl, Button*, void ); DECL_LINK ( SelectServiceHdl, void * ); DECL_LINK_TYPED ( EditServiceMenuHdl, MenuButton *, void ); @@ -198,10 +198,10 @@ private: DECL_LINK_TYPED( SelectBreadcrumbHdl, Breadcrumb *, void ); - DECL_LINK( NewFolderHdl, void * ); + DECL_LINK_TYPED( NewFolderHdl, Button*, void ); - DECL_LINK( OkHdl, void * ); - DECL_LINK( CancelHdl, void * ); + DECL_LINK_TYPED( OkHdl, Button*, void ); + DECL_LINK_TYPED( CancelHdl, Button*, void ); }; #endif // INCLUDED_SVTOOLS_REMOTEFILESDIALOG_HXX diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 65c0d444786d..6b875793a8e9 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -614,7 +614,7 @@ void SvtFileDialog::Init_Impl // Setting preferences of the control elements. _pImp->_pBtnNewFolder->SetClickHdl( LINK( this, SvtFileDialog, NewFolderHdl_Impl ) ); - _pImp->_pBtnFileOpen->SetClickHdl( LINK( this, SvtFileDialog, OpenHdl_Impl ) ); + _pImp->_pBtnFileOpen->SetClickHdl( LINK( this, SvtFileDialog, OpenClickHdl_Impl ) ); _pImp->_pBtnCancel->SetClickHdl( LINK( this, SvtFileDialog, CancelHdl_Impl ) ); _pImp->SetFilterListSelectHdl( LINK( this, SvtFileDialog, FilterSelectHdl_Impl ) ); _pImp->_pEdFileName->SetGetFocusHdl( LINK( this, SvtFileDialog, FileNameGetFocusHdl_Impl ) ); @@ -674,7 +674,7 @@ void SvtFileDialog::Init_Impl Resize(); } -IMPL_LINK( SvtFileDialog, NewFolderHdl_Impl, PushButton*, ) +IMPL_LINK_NOARG_TYPED( SvtFileDialog, NewFolderHdl_Impl, Button*, void) { _pFileView->EndInplaceEditing( false ); @@ -698,8 +698,6 @@ IMPL_LINK( SvtFileDialog, NewFolderHdl_Impl, PushButton*, ) else bHandled = true; } - - return 0; } bool SvtFileDialog::createNewUserFilter( const OUString& _rNewFilter, bool _bAllowUserDefExt ) @@ -816,7 +814,7 @@ sal_uInt16 SvtFileDialog::adjustFilter( const OUString& _rFilter ) } -IMPL_LINK_NOARG(SvtFileDialog, CancelHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvtFileDialog, CancelHdl_Impl, Button*, void) { if ( m_pCurrentAsyncAction.is() ) { @@ -827,10 +825,13 @@ IMPL_LINK_NOARG(SvtFileDialog, CancelHdl_Impl) { EndDialog(); } - return 1L; } +IMPL_LINK_TYPED( SvtFileDialog, OpenClickHdl_Impl, Button*, pVoid, void ) +{ + OpenHdl_Impl(pVoid); +} IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) { if ( _pImp->_bMultiSelection && _pFileView->GetSelectionCount() > 1 ) @@ -1253,7 +1254,7 @@ IMPL_LINK_NOARG( SvtFileDialog, URLBoxModifiedHdl_Impl ) -IMPL_LINK_NOARG( SvtFileDialog, ConnectToServerPressed_Hdl ) +IMPL_LINK_NOARG_TYPED( SvtFileDialog, ConnectToServerPressed_Hdl, Button*, void ) { _pFileView->EndInplaceEditing( false ); @@ -1273,13 +1274,11 @@ IMPL_LINK_NOARG( SvtFileDialog, ConnectToServerPressed_Hdl ) // Do Nothing break; }; - - return 0; } -IMPL_LINK_NOARG ( SvtFileDialog, AddPlacePressed_Hdl ) +IMPL_LINK_NOARG_TYPED ( SvtFileDialog, AddPlacePressed_Hdl, Button*, void ) { // Maybe open the PlacesDialog would have been a better idea // there is an ux choice to make we did not make... @@ -1288,15 +1287,13 @@ IMPL_LINK_NOARG ( SvtFileDialog, AddPlacePressed_Hdl ) new Place( aURLObj.GetLastName(INetURLObject::DECODE_WITH_CHARSET), OUString(_pFileView->GetViewURL()), true)); _pImp->_pPlaces->AppendPlace(newPlace); - return 0; } -IMPL_LINK_NOARG ( SvtFileDialog, RemovePlacePressed_Hdl ) +IMPL_LINK_NOARG_TYPED ( SvtFileDialog, RemovePlacePressed_Hdl, Button*, void ) { _pImp->_pPlaces->RemoveSelectedPlace(); - return 0; } @@ -1549,7 +1546,7 @@ IMPL_LINK( SvtFileDialog, OpenDoneHdl_Impl, SvtFileView*, pView ) -IMPL_LINK_NOARG(SvtFileDialog, AutoExtensionHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvtFileDialog, AutoExtensionHdl_Impl, Button*, void) { if ( _pFileNotifier ) _pFileNotifier->notify( CTRL_STATE_CHANGED, @@ -1557,16 +1554,14 @@ IMPL_LINK_NOARG(SvtFileDialog, AutoExtensionHdl_Impl) // update the extension of the current file if necessary lcl_autoUpdateFileExtension( this, _pImp->GetCurFilter()->GetExtension() ); - - return 0; } -IMPL_LINK( SvtFileDialog, ClickHdl_Impl, CheckBox*, pCheckBox ) +IMPL_LINK_TYPED( SvtFileDialog, ClickHdl_Impl, Button*, pCheckBox, void ) { if ( ! _pFileNotifier ) - return 0; + return; sal_Int16 nId = -1; @@ -1585,19 +1580,15 @@ IMPL_LINK( SvtFileDialog, ClickHdl_Impl, CheckBox*, pCheckBox ) if ( nId != -1 ) _pFileNotifier->notify( CTRL_STATE_CHANGED, nId ); - - return 0; } -IMPL_LINK_NOARG(SvtFileDialog, PlayButtonHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvtFileDialog, PlayButtonHdl_Impl, Button*, void) { if ( _pFileNotifier ) _pFileNotifier->notify( CTRL_STATE_CHANGED, PUSHBUTTON_PLAY ); - - return 0; } @@ -2860,12 +2851,11 @@ void QueryFolderNameDialog::dispose() ModalDialog::dispose(); } -IMPL_LINK_NOARG(QueryFolderNameDialog, OKHdl) +IMPL_LINK_NOARG_TYPED(QueryFolderNameDialog, OKHdl, Button*, void) { // trim the strings m_pNameEdit->SetText(comphelper::string::strip(m_pNameEdit->GetText(), ' ')); EndDialog( RET_OK ); - return 1; } diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx index 385613926d26..f9950a0c05ea 100644 --- a/fpicker/source/office/iodlg.hxx +++ b/fpicker/source/office/iodlg.hxx @@ -92,18 +92,19 @@ private: DECL_LINK( FilterSelectHdl_Impl, void* ); DECL_LINK_TYPED( FilterSelectTimerHdl_Impl, Timer*, void ); - DECL_LINK( NewFolderHdl_Impl, PushButton* ); + DECL_LINK_TYPED( NewFolderHdl_Impl, Button*, void ); DECL_LINK( OpenHdl_Impl, void* ); - DECL_LINK ( CancelHdl_Impl, void* ); + DECL_LINK_TYPED( OpenClickHdl_Impl, Button*, void ); + DECL_LINK_TYPED( CancelHdl_Impl, Button*, void ); DECL_LINK( FileNameGetFocusHdl_Impl, void* ); DECL_LINK( FileNameModifiedHdl_Impl, void* ); DECL_LINK( URLBoxModifiedHdl_Impl, void* ); - DECL_LINK( ConnectToServerPressed_Hdl, void* ); + DECL_LINK_TYPED( ConnectToServerPressed_Hdl, Button*, void ); - DECL_LINK ( AddPlacePressed_Hdl, void* ); - DECL_LINK ( RemovePlacePressed_Hdl, void* ); - DECL_LINK ( Split_Hdl, void* ); + DECL_LINK_TYPED( AddPlacePressed_Hdl, Button*, void ); + DECL_LINK_TYPED( RemovePlacePressed_Hdl, Button*, void ); + DECL_LINK ( Split_Hdl, void* ); void Init_Impl( WinBits nBits ); /** find a filter with the given wildcard @@ -128,9 +129,9 @@ private: DECL_LINK(DblClickHdl_Impl, void *); DECL_LINK(EntrySelectHdl_Impl, void *); DECL_LINK( OpenDoneHdl_Impl, SvtFileView* ); - DECL_LINK(AutoExtensionHdl_Impl, void *); - DECL_LINK( ClickHdl_Impl, CheckBox* ); - DECL_LINK(PlayButtonHdl_Impl, void *); + DECL_LINK_TYPED(AutoExtensionHdl_Impl, Button*, void); + DECL_LINK_TYPED( ClickHdl_Impl, Button*, void ); + DECL_LINK_TYPED(PlayButtonHdl_Impl, Button*, void); // removes a filter with wildcards from the path and returns it |