diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-30 10:20:00 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-30 10:20:00 +0200 |
commit | 3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed (patch) | |
tree | bdfd28afe5a452060e3d985c5f01b45f4b7bc2cd /sw/source/ui/dialog | |
parent | 57d254d42b6e1d836bd21e6fb2e968af2b511c7d (diff) |
Gradually typed Link
Turn the Link class into a template abstracting over the link's argument and
return types, but provide default template arguments that keep the generic,
unsafe "void* in, sal_IntPtr out" behvior. That way, individual uses of the
Link class can be updated over time.
All the related macros are duplicated with ..._TYPED counterparts, that
additionally take the RetType (except for LINK_TYPED, which manages to infer the
relevant types from the supplied Member).
(It would have been attractive to change the "untyped" LinkStubs from taking a
void* to a properly typed ArgType parameter, too, but that would cause
-fsanitize=function to flag uses of "untyped" Link::Call.)
Change-Id: I3b0140378bad99abbf240140ebb4a46a05d2d2f8
Diffstat (limited to 'sw/source/ui/dialog')
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 8 | ||||
-rw-r--r-- | sw/source/ui/dialog/uiregionsw.cxx | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index a372be0067d2..28d8bbd25233 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -168,7 +168,7 @@ IMPL_LINK_NOARG(AbstractApplyTabDialog_Impl, ApplyHdl) return 0; } -void AbstractApplyTabDialog_Impl::SetApplyHdl( const Link& rLink ) +void AbstractApplyTabDialog_Impl::SetApplyHdl( const Link<>& rLink ) { m_aHandler = rLink; pDlg->SetApplyHandler(LINK(this, AbstractApplyTabDialog_Impl, ApplyHdl)); @@ -598,7 +598,7 @@ AbstractMailMergeWizard_Impl::~AbstractMailMergeWizard_Impl() pDlg.disposeAndClear(); } -void AbstractMailMergeWizard_Impl::StartExecuteModal( const Link& rEndDialogHdl ) +void AbstractMailMergeWizard_Impl::StartExecuteModal( const Link<>& rEndDialogHdl ) { aEndDlgHdl = rEndDialogHdl; pDlg->StartExecuteModal( @@ -616,7 +616,7 @@ IMPL_LINK( AbstractMailMergeWizard_Impl, EndDialogHdl, SwMailMergeWizard*, pDial (void) pDialog; // unused in non-debug aEndDlgHdl.Call( this ); - aEndDlgHdl = Link(); + aEndDlgHdl = Link<>(); return 0L; } diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 8384f03b98c3..7ef801594e14 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -137,8 +137,8 @@ public: } DECL_LINK(ApplyHdl, void*); private: - Link m_aHandler; - virtual void SetApplyHdl( const Link& rLink ) SAL_OVERRIDE; + Link<> m_aHandler; + virtual void SetApplyHdl( const Link<>& rLink ) SAL_OVERRIDE; }; class AbstractSwConvertTableDlg_Impl : public AbstractSwConvertTableDlg @@ -350,7 +350,7 @@ class SwMailMergeWizard; class AbstractMailMergeWizard_Impl : public AbstractMailMergeWizard { VclPtr<SwMailMergeWizard> pDlg; - Link aEndDlgHdl; + Link<> aEndDlgHdl; DECL_LINK( EndDialogHdl, SwMailMergeWizard* ); public: @@ -358,7 +358,7 @@ public: : pDlg(p) {} virtual ~AbstractMailMergeWizard_Impl(); - virtual void StartExecuteModal( const Link& rEndDialogHdl ) SAL_OVERRIDE; + virtual void StartExecuteModal( const Link<>& rEndDialogHdl ) SAL_OVERRIDE; virtual long GetResult() SAL_OVERRIDE; virtual void SetReloadDocument(const OUString& rURL) SAL_OVERRIDE; diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 65a40c87b2d9..d72739d5c533 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -1874,7 +1874,7 @@ SwSectionFtnEndTabPage::SwSectionFtnEndTabPage( vcl::Window *pParent, get(pEndSuffixFT,"endsuffix_label"); get(pEndSuffixED,"endsuffix"); - Link aLk( LINK( this, SwSectionFtnEndTabPage, FootEndHdl)); + Link<> aLk( LINK( this, SwSectionFtnEndTabPage, FootEndHdl)); pFtnNtAtTextEndCB->SetClickHdl( aLk ); pFtnNtNumCB->SetClickHdl( aLk ); pEndNtAtTextEndCB->SetClickHdl( aLk ); @@ -2165,7 +2165,7 @@ SwSectionIndentTabPage::SwSectionIndentTabPage(vcl::Window *pParent, const SfxIt get(m_pBeforeMF, "before"); get(m_pAfterMF, "after"); get(m_pPreviewWin, "preview"); - Link aLk = LINK(this, SwSectionIndentTabPage, IndentModifyHdl); + Link<> aLk = LINK(this, SwSectionIndentTabPage, IndentModifyHdl); m_pBeforeMF->SetModifyHdl(aLk); m_pAfterMF->SetModifyHdl(aLk); } |