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 /desktop | |
parent | 46a27805fb707544a844a961a3743b8b992282f0 (diff) |
Convert vcl Button Link<> click handler to typed Link<Button*,void>
Change-Id: Ie80dfb003118d40741549c41ebcc7eda4819f05b
Diffstat (limited to 'desktop')
7 files changed, 35 insertions, 56 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 767500d8eb41..cd2176a559d7 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -131,9 +131,9 @@ class ExtBoxWithBtns_Impl : public ExtensionBox_Impl DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar * ); - DECL_DLLPRIVATE_LINK( HandleOptionsBtn, void * ); - DECL_DLLPRIVATE_LINK( HandleEnableBtn, void * ); - DECL_DLLPRIVATE_LINK( HandleRemoveBtn, void * ); + DECL_DLLPRIVATE_LINK_TYPED( HandleOptionsBtn, Button*, void ); + DECL_DLLPRIVATE_LINK_TYPED( HandleEnableBtn, Button*, void ); + DECL_DLLPRIVATE_LINK_TYPED( HandleRemoveBtn, Button*, void ); public: explicit ExtBoxWithBtns_Impl(vcl::Window* pParent); @@ -486,7 +486,7 @@ IMPL_LINK( ExtBoxWithBtns_Impl, ScrollHdl, ScrollBar*, pScrBar ) } -IMPL_LINK_NOARG(ExtBoxWithBtns_Impl, HandleOptionsBtn) +IMPL_LINK_NOARG_TYPED(ExtBoxWithBtns_Impl, HandleOptionsBtn, Button*, void) { const sal_Int32 nActive = getSelIndex(); @@ -502,12 +502,10 @@ IMPL_LINK_NOARG(ExtBoxWithBtns_Impl, HandleOptionsBtn) pDlg->Execute(); } } - - return 1; } -IMPL_LINK_NOARG(ExtBoxWithBtns_Impl, HandleEnableBtn) +IMPL_LINK_NOARG_TYPED(ExtBoxWithBtns_Impl, HandleEnableBtn, Button*, void) { const sal_Int32 nActive = getSelIndex(); @@ -523,12 +521,10 @@ IMPL_LINK_NOARG(ExtBoxWithBtns_Impl, HandleEnableBtn) m_pParent->enablePackage( pEntry->m_xPackage, bEnable ); } } - - return 1; } -IMPL_LINK_NOARG(ExtBoxWithBtns_Impl, HandleRemoveBtn) +IMPL_LINK_NOARG_TYPED(ExtBoxWithBtns_Impl, HandleRemoveBtn, Button*, void) { const sal_Int32 nActive = getSelIndex(); @@ -537,8 +533,6 @@ IMPL_LINK_NOARG(ExtBoxWithBtns_Impl, HandleRemoveBtn) TEntry_Impl pEntry = GetEntryData( nActive ); m_pParent->removePackage( pEntry->m_xPackage ); } - - return 1; } @@ -951,7 +945,7 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker() } -IMPL_LINK_NOARG(ExtMgrDialog, HandleCancelBtn) +IMPL_LINK_NOARG_TYPED(ExtMgrDialog, HandleCancelBtn, Button*, void) { if ( m_xAbortChannel.is() ) { @@ -964,13 +958,11 @@ IMPL_LINK_NOARG(ExtMgrDialog, HandleCancelBtn) OSL_FAIL( "### unexpected RuntimeException!" ); } } - return 1; } -IMPL_LINK_NOARG(ExtMgrDialog, HandleCloseBtn) +IMPL_LINK_NOARG_TYPED(ExtMgrDialog, HandleCloseBtn, Button*, void) { Close(); - return 1; } @@ -1056,7 +1048,7 @@ void ExtMgrDialog::updatePackageInfo( const uno::Reference< deployment::XPackage } -IMPL_LINK_NOARG(ExtMgrDialog, HandleAddBtn) +IMPL_LINK_NOARG_TYPED(ExtMgrDialog, HandleAddBtn, Button*, void) { setBusy( true ); @@ -1068,23 +1060,20 @@ IMPL_LINK_NOARG(ExtMgrDialog, HandleAddBtn) } setBusy( false ); - return 1; } -IMPL_LINK_NOARG(ExtMgrDialog, HandleExtTypeCbx) +IMPL_LINK_NOARG_TYPED(ExtMgrDialog, HandleExtTypeCbx, Button*, void) { // re-creates the list of packages with addEntry selecting the packages m_pManager->createPackageList(); - return 1; } -IMPL_LINK_NOARG(ExtMgrDialog, HandleUpdateBtn) +IMPL_LINK_NOARG_TYPED(ExtMgrDialog, HandleUpdateBtn, Button*, void) { #if ENABLE_EXTENSION_UPDATE m_pManager->checkUpdates( false, true ); #endif - return 1; } @@ -1282,7 +1271,7 @@ bool UpdateRequiredDialog::enablePackage( const uno::Reference< deployment::XPac } -IMPL_LINK_NOARG(UpdateRequiredDialog, HandleCancelBtn) +IMPL_LINK_NOARG_TYPED(UpdateRequiredDialog, HandleCancelBtn, Button*, void) { if ( m_xAbortChannel.is() ) { @@ -1295,7 +1284,6 @@ IMPL_LINK_NOARG(UpdateRequiredDialog, HandleCancelBtn) OSL_FAIL( "### unexpected RuntimeException!" ); } } - return 1; } @@ -1388,7 +1376,7 @@ void UpdateRequiredDialog::updatePackageInfo( const uno::Reference< deployment:: } -IMPL_LINK_NOARG(UpdateRequiredDialog, HandleUpdateBtn) +IMPL_LINK_NOARG_TYPED(UpdateRequiredDialog, HandleUpdateBtn, Button*, void) { ::osl::ClearableMutexGuard aGuard( m_aMutex ); @@ -1404,12 +1392,10 @@ IMPL_LINK_NOARG(UpdateRequiredDialog, HandleUpdateBtn) aGuard.clear(); m_pManager->getCmdQueue()->checkForUpdates( vUpdateEntries ); - - return 1; } -IMPL_LINK_NOARG(UpdateRequiredDialog, HandleCloseBtn) +IMPL_LINK_NOARG_TYPED(UpdateRequiredDialog, HandleCloseBtn, Button*, void) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -1422,8 +1408,6 @@ IMPL_LINK_NOARG(UpdateRequiredDialog, HandleCloseBtn) else EndDialog(); } - - return 1; } diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx index 234435116364..df227bd726c6 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx @@ -131,11 +131,11 @@ class ExtMgrDialog : public ModelessDialog, bool removeExtensionWarn( const OUString &rExtensionTitle ) const; - DECL_DLLPRIVATE_LINK( HandleAddBtn, void * ); - DECL_DLLPRIVATE_LINK( HandleUpdateBtn, void * ); - DECL_DLLPRIVATE_LINK( HandleCancelBtn, void * ); - DECL_DLLPRIVATE_LINK( HandleCloseBtn, void * ); - DECL_DLLPRIVATE_LINK( HandleExtTypeCbx, void * ); + DECL_DLLPRIVATE_LINK_TYPED( HandleAddBtn, Button*, void ); + DECL_DLLPRIVATE_LINK_TYPED( HandleUpdateBtn, Button*, void ); + DECL_DLLPRIVATE_LINK_TYPED( HandleCancelBtn, Button*, void ); + DECL_DLLPRIVATE_LINK_TYPED( HandleCloseBtn, Button*, void ); + DECL_DLLPRIVATE_LINK_TYPED( HandleExtTypeCbx, Button*, void ); DECL_DLLPRIVATE_LINK( HandleHyperlink, FixedHyperlink * ); DECL_DLLPRIVATE_LINK_TYPED(TimeOutHdl, Idle *, void); DECL_DLLPRIVATE_LINK( startProgress, void * ); @@ -197,9 +197,9 @@ class UpdateRequiredDialog : public ModalDialog, ::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > m_xAbortChannel; - DECL_DLLPRIVATE_LINK( HandleUpdateBtn, void * ); - DECL_DLLPRIVATE_LINK( HandleCloseBtn, void * ); - DECL_DLLPRIVATE_LINK( HandleCancelBtn, void * ); + DECL_DLLPRIVATE_LINK_TYPED( HandleUpdateBtn, Button*, void ); + DECL_DLLPRIVATE_LINK_TYPED( HandleCloseBtn, Button*, void ); + DECL_DLLPRIVATE_LINK_TYPED( HandleCancelBtn, Button*, void ); DECL_DLLPRIVATE_LINK_TYPED(TimeOutHdl, Idle *, void); DECL_DLLPRIVATE_LINK( startProgress, void * ); DECL_DLLPRIVATE_LINK( HandleHyperlink, FixedHyperlink * ); diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index 7a6e2e319208..d6619adb2c40 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -1291,7 +1291,7 @@ IMPL_LINK_NOARG(UpdateDialog, allHandler) return 0; } -IMPL_LINK_NOARG(UpdateDialog, okHandler) +IMPL_LINK_NOARG_TYPED(UpdateDialog, okHandler, Button*, void) { //If users are going to update a shared extension then we need //to warn them @@ -1314,13 +1314,12 @@ IMPL_LINK_NOARG(UpdateDialog, okHandler) } EndDialog(RET_OK); - return 0; } -IMPL_LINK_NOARG(UpdateDialog, closeHandler) { +IMPL_LINK_NOARG_TYPED(UpdateDialog, closeHandler, Button*, void) +{ m_thread->stop(); EndDialog(); - return 0; } IMPL_LINK( UpdateDialog, hyperlink_clicked, FixedHyperlink*, pHyperlink ) diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx index c3e7acf41b54..610497fd1721 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx @@ -161,8 +161,8 @@ private: DECL_LINK(selectionHandler, void *); DECL_LINK(allHandler, void *); - DECL_LINK(okHandler, void *); - DECL_LINK(closeHandler, void *); + DECL_LINK_TYPED(okHandler, Button*, void); + DECL_LINK_TYPED(closeHandler, Button*, void); DECL_LINK(hyperlink_clicked, FixedHyperlink *); com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx index 849942b0006a..3d94cb18b5c7 100644 --- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx @@ -323,11 +323,10 @@ void UpdateInstallDialog::setError(OUString const & exceptionMessage) m_pMle_info->SetText(m_pMle_info->GetText() + exceptionMessage + "\n"); } -IMPL_LINK_NOARG(UpdateInstallDialog, cancelHandler) +IMPL_LINK_NOARG_TYPED(UpdateInstallDialog, cancelHandler, Button*, void) { m_thread->stop(); EndDialog(); - return 0; } void UpdateInstallDialog::Thread::downloadExtensions() diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx index 9c05abd36358..00e289a564c5 100644 --- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx +++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx @@ -73,7 +73,7 @@ private: friend class Thread; friend class UpdateCommandEnv; - DECL_LINK(cancelHandler, void *); + DECL_LINK_TYPED(cancelHandler, Button*, void); //signals in the dialog that we have finished. void updateDone(); diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx index 2118c57a415c..531d84d8524b 100644 --- a/desktop/source/deployment/gui/license_dialog.cxx +++ b/desktop/source/deployment/gui/license_dialog.cxx @@ -85,11 +85,11 @@ struct LicenseDialogImpl : public ModalDialog VclPtr<PushButton> m_pAcceptButton; VclPtr<PushButton> m_pDeclineButton; - DECL_LINK(PageDownHdl, void *); + DECL_LINK_TYPED(PageDownHdl, Button*, void); DECL_LINK(ScrolledHdl, void *); DECL_LINK(EndReachedHdl, void *); - DECL_LINK(CancelHdl, void *); - DECL_LINK(AcceptHdl, void *); + DECL_LINK_TYPED(CancelHdl, Button*, void); + DECL_LINK_TYPED(AcceptHdl, Button*, void); bool m_bLicenseRead; @@ -241,16 +241,14 @@ LicenseDialogImpl::LicenseDialogImpl( m_pDown->SetStyle( aStyle ); } -IMPL_LINK_NOARG(LicenseDialogImpl, AcceptHdl) +IMPL_LINK_NOARG_TYPED(LicenseDialogImpl, AcceptHdl, Button*, void) { EndDialog(RET_OK); - return 0; } -IMPL_LINK_NOARG(LicenseDialogImpl, CancelHdl) +IMPL_LINK_NOARG_TYPED(LicenseDialogImpl, CancelHdl, Button*, void) { EndDialog(); - return 0; } void LicenseDialogImpl::Activate() @@ -284,10 +282,9 @@ IMPL_LINK_NOARG(LicenseDialogImpl, ScrolledHdl) return 0; } -IMPL_LINK_NOARG(LicenseDialogImpl, PageDownHdl) +IMPL_LINK_NOARG_TYPED(LicenseDialogImpl, PageDownHdl, Button*, void) { m_pLicense->ScrollDown( SCROLL_PAGEDOWN ); - return 0; } IMPL_LINK_NOARG(LicenseDialogImpl, EndReachedHdl) |