From cf0c04a428754dfd5aa477cebc5441bc74e27005 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 10 Sep 2015 14:39:17 +0200 Subject: convert Link<> to typed Change-Id: I85658fa35b9b85106a3b9c8ef303584cad6f39b0 --- sfx2/source/appl/newhelp.cxx | 7 ++++--- sfx2/source/appl/newhelp.hxx | 7 ++++--- sfx2/source/dialog/templdlg.cxx | 10 +++++++--- sfx2/source/dialog/versdlg.cxx | 4 ++-- sfx2/source/inc/templdgi.hxx | 1 + sfx2/source/inc/versdlg.hxx | 2 +- 6 files changed, 19 insertions(+), 12 deletions(-) (limited to 'sfx2/source') diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 00ef0bc5b7f6..964282975222 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1726,8 +1726,6 @@ void SfxHelpIndexWindow_Impl::DataChanged( const DataChangedEvent& rDCEvt ) void SfxHelpIndexWindow_Impl::SetDoubleClickHdl( const Link<>& rLink ) { aPageDoubleClickLink = rLink; - if ( pCPage ) - pCPage->SetOpenHdl( aPageDoubleClickLink ); if ( pIPage ) pIPage->SetDoubleClickHdl( aPageDoubleClickLink ); if ( pSPage ) @@ -1736,7 +1734,10 @@ void SfxHelpIndexWindow_Impl::SetDoubleClickHdl( const Link<>& rLink ) pBPage->SetDoubleClickHdl( aPageDoubleClickLink ); } - +IMPL_LINK_TYPED(SfxHelpIndexWindow_Impl, ContentTabPageDoubleClickHdl, SvTreeListBox*, p, bool) +{ + return aPageDoubleClickLink.Call(p); +} void SfxHelpIndexWindow_Impl::SetFactory( const OUString& rFactory, bool bActive ) { diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index f3e35895b095..29728f853784 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -64,7 +64,7 @@ public: virtual void RequestingChildren( SvTreeListEntry* pParent ) SAL_OVERRIDE; virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE; - inline void SetOpenHdl( const Link<>& rLink ) { SetDoubleClickHdl( rLink ); } + inline void SetOpenHdl( const Link& rLink ) { SetDoubleClickHdl( rLink ); } OUString GetSelectEntry() const; }; @@ -101,7 +101,7 @@ public: virtual void ActivatePage() SAL_OVERRIDE; virtual Control* GetLastFocusControl() SAL_OVERRIDE; - void SetOpenHdl( const Link<>& rLink ) { m_pContentBox->SetOpenHdl( rLink ); } + void SetOpenHdl( const Link& rLink ) { m_pContentBox->SetOpenHdl( rLink ); } OUString GetSelectEntry() const { return m_pContentBox->GetSelectEntry(); } void SetFocusOnBox() { m_pContentBox->GrabFocus(); } }; @@ -317,6 +317,7 @@ private: DECL_LINK_TYPED(InitHdl, Idle *, void); DECL_LINK_TYPED(SelectFactoryHdl, Idle *, void); DECL_LINK(KeywordHdl, void *); + DECL_LINK_TYPED(ContentTabPageDoubleClickHdl, SvTreeListBox*, bool); public: SfxHelpIndexWindow_Impl( SfxHelpWindow_Impl* pParent ); @@ -353,7 +354,7 @@ ContentTabPage_Impl* SfxHelpIndexWindow_Impl::GetContentPage() if ( !pCPage ) { pCPage = VclPtr::Create( m_pTabCtrl, this ); - pCPage->SetOpenHdl( aPageDoubleClickLink ); + pCPage->SetOpenHdl( LINK(this, SfxHelpIndexWindow_Impl, ContentTabPageDoubleClickHdl) ); } return pCPage; } diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 1f1cc098d547..52ab26072267 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -866,7 +866,7 @@ void SfxCommonTemplateDialog_Impl::Initialize() Update_Impl(); aFilterLb->SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, FilterSelectHdl ) ); - aFmtLb->SetDoubleClickHdl( LINK( this, SfxCommonTemplateDialog_Impl, ApplyHdl ) ); + aFmtLb->SetDoubleClickHdl( LINK( this, SfxCommonTemplateDialog_Impl, TreeListApplyHdl ) ); aFmtLb->SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, FmtSelectHdl ) ); aFmtLb->SetSelectionMode(MULTIPLE_SELECTION); @@ -2086,10 +2086,14 @@ void SfxCommonTemplateDialog_Impl::ResetFocus() } } +IMPL_LINK_NOARG_TYPED( SfxCommonTemplateDialog_Impl, TreeListApplyHdl, SvTreeListBox *, bool ) +{ + return ApplyHdl(NULL) == 1; +} + // Double-click on a style sheet in the ListBox is applied. -IMPL_LINK( SfxCommonTemplateDialog_Impl, ApplyHdl, Control *, pControl ) +IMPL_LINK( SfxCommonTemplateDialog_Impl, ApplyHdl, Control *, /*pControl*/ ) { - (void)pControl; //unused // only if that region is allowed if ( IsInitialized() && 0 != pFamilyState[nActFamily-1] && !GetSelectedEntry().isEmpty() ) diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index 1bc6df1a8411..54e73aded93b 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -370,10 +370,10 @@ void SfxVersionDialog::Open_Impl() Close(); } -IMPL_LINK_NOARG(SfxVersionDialog, DClickHdl_Impl) +IMPL_LINK_NOARG_TYPED(SfxVersionDialog, DClickHdl_Impl, SvTreeListBox*, bool) { Open_Impl(); - return 0L; + return false; } IMPL_LINK_NOARG_TYPED(SfxVersionDialog, SelectHdl_Impl, SvTreeListBox*, void) diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx index e9383a47adae..0ece9f511b59 100644 --- a/sfx2/source/inc/templdgi.hxx +++ b/sfx2/source/inc/templdgi.hxx @@ -218,6 +218,7 @@ protected: DECL_LINK( FilterSelectHdl, ListBox* ); DECL_LINK_TYPED( FmtSelectHdl, SvTreeListBox*, void ); DECL_LINK( ApplyHdl, Control* ); + DECL_LINK_TYPED( TreeListApplyHdl, SvTreeListBox*, bool ); DECL_LINK( DropHdl, StyleTreeListBox_Impl* ); DECL_LINK_TYPED( TimeOut, Idle*, void ); diff --git a/sfx2/source/inc/versdlg.hxx b/sfx2/source/inc/versdlg.hxx index b2747d291460..4187343a451a 100644 --- a/sfx2/source/inc/versdlg.hxx +++ b/sfx2/source/inc/versdlg.hxx @@ -57,7 +57,7 @@ class SfxVersionDialog : public SfxModalDialog SfxVersionTableDtor* m_pTable; bool m_bIsSaveVersionOnClose; - DECL_LINK(DClickHdl_Impl, void *); + DECL_LINK_TYPED( DClickHdl_Impl, SvTreeListBox*, bool); DECL_LINK_TYPED( SelectHdl_Impl, SvTreeListBox*, void); DECL_LINK_TYPED( ButtonHdl_Impl, Button*, void ); void Init_Impl(); -- cgit