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 /basctl | |
parent | 46a27805fb707544a844a961a3743b8b992282f0 (diff) |
Convert vcl Button Link<> click handler to typed Link<Button*,void>
Change-Id: Ie80dfb003118d40741549c41ebcc7eda4819f05b
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/baside2.hxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 3 | ||||
-rw-r--r-- | basctl/source/basicide/brkdlg.cxx | 9 | ||||
-rw-r--r-- | basctl/source/basicide/brkdlg.hxx | 4 | ||||
-rw-r--r-- | basctl/source/basicide/macrodlg.cxx | 17 | ||||
-rw-r--r-- | basctl/source/basicide/macrodlg.hxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/moduldl2.cxx | 14 | ||||
-rw-r--r-- | basctl/source/basicide/moduldlg.cxx | 4 | ||||
-rw-r--r-- | basctl/source/basicide/moduldlg.hxx | 10 | ||||
-rw-r--r-- | basctl/source/dlged/managelang.cxx | 10 | ||||
-rw-r--r-- | basctl/source/inc/managelang.hxx | 6 |
11 files changed, 33 insertions, 48 deletions
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx index f3d22e797557..bf2fc8f86314 100644 --- a/basctl/source/basicide/baside2.hxx +++ b/basctl/source/basicide/baside2.hxx @@ -233,7 +233,7 @@ protected: virtual void Resize() SAL_OVERRIDE; virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) SAL_OVERRIDE; - DECL_LINK( ButtonHdl, ImageButton * ); + DECL_LINK_TYPED( ButtonHdl, Button *, void ); DECL_LINK(TreeListHdl, void *); DECL_LINK( implEndDragHdl, HeaderBar * ); DECL_LINK_TYPED( EditAccHdl, Accelerator *, void ); diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index ca9009c0c263..786f6d7bcfed 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -1783,12 +1783,11 @@ bool WatchWindow::RemoveSelectedWatch() } -IMPL_LINK( WatchWindow, ButtonHdl, ImageButton *, pButton ) +IMPL_LINK_TYPED( WatchWindow, ButtonHdl, Button *, pButton, void ) { if (pButton == aRemoveWatchButton.get()) if (SfxDispatcher* pDispatcher = GetDispatcher()) pDispatcher->Execute(SID_BASICIDE_REMOVEWATCH); - return 0; } IMPL_LINK_NOARG(WatchWindow, TreeListHdl) diff --git a/basctl/source/basicide/brkdlg.cxx b/basctl/source/basicide/brkdlg.cxx index 084d15eb8f51..b249c6c03b98 100644 --- a/basctl/source/basicide/brkdlg.cxx +++ b/basctl/source/basicide/brkdlg.cxx @@ -150,13 +150,12 @@ void BreakPointDialog::CheckButtons() } } -IMPL_LINK( BreakPointDialog, CheckBoxHdl, ::CheckBox *, pChkBx ) +IMPL_LINK_TYPED( BreakPointDialog, CheckBoxHdl, Button *, pButton, void ) { + ::CheckBox * pChkBx = static_cast<::CheckBox*>(pButton); BreakPoint* pBrk = GetSelectedBreakPoint(); if ( pBrk ) pBrk->bEnabled = pChkBx->IsChecked(); - - return 0; } IMPL_LINK( BreakPointDialog, ComboBoxHighlightHdl, ComboBox *, pBox ) @@ -190,7 +189,7 @@ IMPL_LINK( BreakPointDialog, EditModifyHdl, Edit *, pEdit ) -IMPL_LINK( BreakPointDialog, ButtonHdl, Button *, pButton ) +IMPL_LINK_TYPED( BreakPointDialog, ButtonHdl, Button *, pButton, void ) { if (pButton == m_pOKButton) { @@ -237,8 +236,6 @@ IMPL_LINK( BreakPointDialog, ButtonHdl, Button *, pButton ) } CheckButtons(); } - - return 0; } diff --git a/basctl/source/basicide/brkdlg.hxx b/basctl/source/basicide/brkdlg.hxx index 50d18543d846..9d032b6ca513 100644 --- a/basctl/source/basicide/brkdlg.hxx +++ b/basctl/source/basicide/brkdlg.hxx @@ -43,10 +43,10 @@ private: protected: void CheckButtons(); - DECL_LINK( CheckBoxHdl, ::CheckBox * ); + DECL_LINK_TYPED( CheckBoxHdl, Button*, void ); DECL_LINK( ComboBoxHighlightHdl, ComboBox * ); DECL_LINK( EditModifyHdl, Edit * ); - DECL_LINK( ButtonHdl, Button * ); + DECL_LINK_TYPED( ButtonHdl, Button*, void ); void UpdateFields( BreakPoint* pBrk ); BreakPoint* GetSelectedBreakPoint(); diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index 1d06e969676b..6d831333eb7b 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -613,7 +613,7 @@ IMPL_LINK( MacroChooser, EditModifyHdl, Edit *, pEdit ) -IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) +IMPL_LINK_TYPED( MacroChooser, ButtonHdl, Button *, pButton, void ) { // apart from New/Record the Description is done by LoseFocus if (pButton == m_pRunButton) @@ -633,7 +633,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) if ( aDocument.isDocument() && !aDocument.allowMacros() ) { ScopedVclPtrInstance<MessageDialog>::Create(this, IDEResId(RID_STR_CANNOTRUNMACRO), VCL_MESSAGE_WARNING)->Execute(); - return 0; + return; } } } @@ -644,12 +644,12 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) ScopedVclPtrInstance<MessageDialog>::Create(this, IDEResId(RID_STR_BADSBXNAME))->Execute(); m_pMacroNameEdit->SetSelection( Selection( 0, m_pMacroNameEdit->GetText().getLength() ) ); m_pMacroNameEdit->GrabFocus(); - return 0; + return; } SbMethod* pMethod = GetMacro(); if ( pMethod && !QueryReplaceMacro( pMethod->GetName(), this ) ) - return 0; + return; } EndDialog(Macro_OkRun); @@ -666,7 +666,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) ScriptDocument aDocument( aDesc.GetDocument() ); DBG_ASSERT( aDocument.isAlive(), "MacroChooser::ButtonHdl: no document, or document is dead!" ); if ( !aDocument.isAlive() ) - return 0; + return; BasicManager* pBasMgr = aDocument.getBasicManager(); OUString aLib( aDesc.GetLibName() ); OUString aMod( aDesc.GetName() ); @@ -712,7 +712,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) ScopedVclPtrInstance<MessageDialog>::Create(this, IDEResId(RID_STR_BADSBXNAME))->Execute(); m_pMacroNameEdit->SetSelection( Selection( 0, m_pMacroNameEdit->GetText().getLength() ) ); m_pMacroNameEdit->GrabFocus(); - return 1; + return; } SbMethod* pMethod = CreateMacro(); if ( pMethod ) @@ -739,7 +739,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) ScriptDocument aDocument( aDesc.GetDocument() ); DBG_ASSERT( aDocument.isAlive(), "MacroChooser::ButtonHdl: no document, or document is dead!" ); if ( !aDocument.isAlive() ) - return 0; + return; BasicManager* pBasMgr = aDocument.getBasicManager(); OUString aLib( aDesc.GetLibName() ); OUString aMod( aDesc.GetName() ); @@ -783,7 +783,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) if ( nRet ) // not only closed { EndDialog(Macro_Edit); - return 0; + return; } Shell* pShell = GetShell(); @@ -792,7 +792,6 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) m_pBasicBox->UpdateEntries(); } - return 0; } diff --git a/basctl/source/basicide/macrodlg.hxx b/basctl/source/basicide/macrodlg.hxx index c9c36cee13a6..bbb4e2811201 100644 --- a/basctl/source/basicide/macrodlg.hxx +++ b/basctl/source/basicide/macrodlg.hxx @@ -71,7 +71,7 @@ private: DECL_LINK(MacroDoubleClickHdl, void *); DECL_LINK( BasicSelectHdl, SvTreeListBox * ); DECL_LINK( EditModifyHdl, Edit * ); - DECL_LINK( ButtonHdl, Button * ); + DECL_LINK_TYPED( ButtonHdl, Button *, void ); void CheckButtons(); void SaveSetCurEntry( SvTreeListBox& rBox, SvTreeListEntry* pEntry ); diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index ad49d7ab737e..4f56a1a5aaef 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -351,7 +351,7 @@ bool CheckBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewName ) } // NewObjectDialog -IMPL_LINK_NOARG(NewObjectDialog, OkButtonHandler) +IMPL_LINK_NOARG_TYPED(NewObjectDialog, OkButtonHandler, Button*, void) { if (IsValidSbxName(m_pEdit->GetText())) EndDialog(1); @@ -360,7 +360,6 @@ IMPL_LINK_NOARG(NewObjectDialog, OkButtonHandler) ScopedVclPtrInstance<MessageDialog>::Create(this, IDE_RESSTR(RID_STR_BADSBXNAME))->Execute(); m_pEdit->GrabFocus(); } - return 0; } NewObjectDialog::NewObjectDialog(vcl::Window * pParent, ObjectMode::Mode eMode, @@ -434,21 +433,19 @@ sal_Int32 GotoLineDialog::GetLineNumber() const return m_pEdit->GetText().toInt32(); } -IMPL_LINK_NOARG(GotoLineDialog, OkButtonHandler) +IMPL_LINK_NOARG_TYPED(GotoLineDialog, OkButtonHandler, Button*, void) { if ( GetLineNumber() ) EndDialog(1); else m_pEdit->SetText(m_pEdit->GetText(), Selection(0, m_pEdit->GetText().getLength())); - return 0; } // ExportDialog -IMPL_LINK_NOARG(ExportDialog, OkButtonHandler) +IMPL_LINK_NOARG_TYPED(ExportDialog, OkButtonHandler, Button*, void) { mbExportAsPackage = m_pExportAsPackageButton->IsChecked(); EndDialog(1); - return 0; } ExportDialog::ExportDialog(vcl::Window * pParent) @@ -623,7 +620,7 @@ IMPL_LINK( LibPage, BasicSelectHdl, ListBox *, pBox ) return 0; } -IMPL_LINK( LibPage, ButtonHdl, Button *, pButton ) +IMPL_LINK_TYPED( LibPage, ButtonHdl, Button *, pButton, void ) { if (pButton == m_pEditButton) { @@ -640,7 +637,7 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton ) pDispatcher->Execute( SID_BASICIDE_LIBSELECTED, SfxCallMode::ASYNCHRON, &aDocItem, &aLibNameItem, 0L ); EndTabDialog( 1 ); - return 0; + return; } else if (pButton == m_pNewLibButton) NewLib(); @@ -709,7 +706,6 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton ) } } CheckButtons(); - return 0; } IMPL_LINK( LibPage, CheckPasswordHdl, SvxPasswordDialog *, pDlg ) diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 0da8cdb3d640..d82e4c196ee7 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -694,7 +694,7 @@ IMPL_LINK( ObjectPage, BasicBoxHighlightHdl, TreeListBox *, pBox ) return 0; } -IMPL_LINK( ObjectPage, ButtonHdl, Button *, pButton ) +IMPL_LINK_TYPED( ObjectPage, ButtonHdl, Button *, pButton, void ) { if (pButton == m_pEditButton) { @@ -749,8 +749,6 @@ IMPL_LINK( ObjectPage, ButtonHdl, Button *, pButton ) NewDialog(); else if (pButton == m_pDelButton) DeleteCurrent(); - - return 0; } bool ObjectPage::GetSelection( ScriptDocument& rDocument, OUString& rLibName ) diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx index c70e8b732a03..61400d2b7e31 100644 --- a/basctl/source/basicide/moduldlg.hxx +++ b/basctl/source/basicide/moduldlg.hxx @@ -51,7 +51,7 @@ private: VclPtr<Edit> m_pEdit; VclPtr<OKButton> m_pOKButton; - DECL_LINK(OkButtonHandler, void *); + DECL_LINK_TYPED(OkButtonHandler, Button*, void); public: NewObjectDialog (vcl::Window* pParent, ObjectMode::Mode, bool bCheckName = false); virtual ~NewObjectDialog(); @@ -68,7 +68,7 @@ class GotoLineDialog : public ModalDialog { VclPtr<Edit> m_pEdit; VclPtr<OKButton> m_pOKButton; - DECL_LINK(OkButtonHandler, void *); + DECL_LINK_TYPED(OkButtonHandler, Button*, void); public: explicit GotoLineDialog(vcl::Window * pParent); virtual ~GotoLineDialog(); @@ -84,7 +84,7 @@ private: bool mbExportAsPackage; - DECL_LINK(OkButtonHandler, void *); + DECL_LINK_TYPED(OkButtonHandler, Button*, void); public: explicit ExportDialog( vcl::Window * pParent ); @@ -191,7 +191,7 @@ protected: VclPtr<PushButton> m_pDelButton; DECL_LINK( BasicBoxHighlightHdl, TreeListBox * ); - DECL_LINK( ButtonHdl, Button * ); + DECL_LINK_TYPED( ButtonHdl, Button *, void ); void CheckButtons(); bool GetSelection( ScriptDocument& rDocument, OUString& rLibName ); void DeleteCurrent(); @@ -231,7 +231,7 @@ protected: DECL_LINK( TreeListHighlightHdl, SvTreeListBox * ); DECL_LINK( BasicSelectHdl, ListBox * ); - DECL_LINK( ButtonHdl, Button * ); + DECL_LINK_TYPED( ButtonHdl, Button *, void ); DECL_LINK( CheckPasswordHdl, SvxPasswordDialog * ); void CheckButtons(); void DeleteCurrent(); diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx index bde64e28cf6e..b1b7f8b120ac 100644 --- a/basctl/source/dlged/managelang.cxx +++ b/basctl/source/dlged/managelang.cxx @@ -144,7 +144,7 @@ void ManageLanguageDialog::ClearLanguageBox() m_pLanguageLB->Clear(); } -IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl) +IMPL_LINK_NOARG_TYPED(ManageLanguageDialog, AddHdl, Button*, void) { ScopedVclPtrInstance< SetDefaultLanguageDialog > aDlg( this, m_xLocalizationMgr ); if ( RET_OK == aDlg->Execute() ) @@ -166,10 +166,9 @@ IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl) if (SfxBindings* pBindings = GetBindingsPtr()) pBindings->Invalidate( SID_BASICIDE_CURRENT_LANG ); } - return 1; } -IMPL_LINK_NOARG(ManageLanguageDialog, DeleteHdl) +IMPL_LINK_NOARG_TYPED(ManageLanguageDialog, DeleteHdl, Button*, void) { ScopedVclPtrInstance< MessageDialog > aQBox(this, "DeleteLangDialog", "modules/BasicIDE/ui/deletelangdialog.ui"); if ( aQBox->Execute() == RET_OK ) @@ -196,10 +195,9 @@ IMPL_LINK_NOARG(ManageLanguageDialog, DeleteHdl) m_pLanguageLB->SelectEntryPos( nPos ); SelectHdl( NULL ); } - return 1; } -IMPL_LINK_NOARG(ManageLanguageDialog, MakeDefHdl) +IMPL_LINK_NOARG_TYPED(ManageLanguageDialog, MakeDefHdl, Button*, void) { sal_uInt16 nPos = m_pLanguageLB->GetSelectEntryPos(); LanguageEntry* pSelectEntry = static_cast<LanguageEntry*>(m_pLanguageLB->GetEntryData( nPos )); @@ -214,8 +212,6 @@ IMPL_LINK_NOARG(ManageLanguageDialog, MakeDefHdl) m_pLanguageLB->SelectEntryPos( nPos ); SelectHdl( NULL ); } - - return 1; } IMPL_LINK_NOARG(ManageLanguageDialog, SelectHdl) diff --git a/basctl/source/inc/managelang.hxx b/basctl/source/inc/managelang.hxx index f7ffc6ed9d1e..0bd64d700fbe 100644 --- a/basctl/source/inc/managelang.hxx +++ b/basctl/source/inc/managelang.hxx @@ -66,9 +66,9 @@ private: void FillLanguageBox(); void ClearLanguageBox(); - DECL_LINK(AddHdl, void *); - DECL_LINK(DeleteHdl, void *); - DECL_LINK(MakeDefHdl, void *); + DECL_LINK_TYPED(AddHdl, Button*, void); + DECL_LINK_TYPED(DeleteHdl, Button*, void); + DECL_LINK_TYPED(MakeDefHdl, Button*, void); DECL_LINK(SelectHdl, void *); public: |