From 3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 30 Apr 2015 10:20:00 +0200 Subject: 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 --- sw/source/ui/table/convert.cxx | 2 +- sw/source/ui/table/tabledlg.cxx | 10 +++++----- sw/source/ui/table/tautofmt.cxx | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sw/source/ui/table') diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx index 63fb7aa83277..20e3cb9b28f0 100644 --- a/sw/source/ui/table/convert.cxx +++ b/sw/source/ui/table/convert.cxx @@ -147,7 +147,7 @@ SwConvertTableDlg::SwConvertTableDlg( SwView& rView, bool bToTable ) } mpKeepColumn->SaveValue(); - Link aLk( LINK(this, SwConvertTableDlg, BtnHdl) ); + Link<> aLk( LINK(this, SwConvertTableDlg, BtnHdl) ); mpTabBtn->SetClickHdl( aLk ); mpSemiBtn->SetClickHdl( aLk ); mpParaBtn->SetClickHdl( aLk ); diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index 00ee90230378..9d60ec655343 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -137,7 +137,7 @@ void SwFormatTablePage::Init() m_aRightMF.SetMetricFieldMin(-999999); //handler - Link aLk = LINK( this, SwFormatTablePage, AutoClickHdl ); + Link<> aLk = LINK( this, SwFormatTablePage, AutoClickHdl ); m_pFullBtn->SetClickHdl( aLk ); m_pFreeBtn->SetClickHdl( aLk ); m_pLeftBtn->SetClickHdl( aLk ); @@ -845,9 +845,9 @@ void SwTableColumnPage::Reset( const SfxItemSet* ) void SwTableColumnPage::Init(bool bWeb) { FieldUnit aMetric = ::GetDfltMetric(bWeb); - Link aLkUp = LINK( this, SwTableColumnPage, UpHdl ); - Link aLkDown = LINK( this, SwTableColumnPage, DownHdl ); - Link aLkLF = LINK( this, SwTableColumnPage, LoseFocusHdl ); + Link<> aLkUp = LINK( this, SwTableColumnPage, UpHdl ); + Link<> aLkDown = LINK( this, SwTableColumnPage, DownHdl ); + Link<> aLkLF = LINK( this, SwTableColumnPage, LoseFocusHdl ); for( sal_uInt16 i = 0; i < MET_FIELDS; i++ ) { aValueTbl[i] = i; @@ -858,7 +858,7 @@ void SwTableColumnPage::Init(bool bWeb) } SetMetric(*m_pSpaceED, aMetric); - Link aLk = LINK( this, SwTableColumnPage, AutoClickHdl ); + Link<> aLk = LINK( this, SwTableColumnPage, AutoClickHdl ); m_pUpBtn->SetClickHdl( aLk ); m_pDownBtn->SetClickHdl( aLk ); diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 5ff495ddafe8..9e1500a926df 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -209,7 +209,7 @@ void SwAutoFormatDlg::dispose() void SwAutoFormatDlg::Init( const SwTableAutoFmt* pSelFmt ) { - Link aLk( LINK( this, SwAutoFormatDlg, CheckHdl ) ); + Link<> aLk( LINK( this, SwAutoFormatDlg, CheckHdl ) ); m_pBtnBorder->SetClickHdl( aLk ); m_pBtnFont->SetClickHdl( aLk ); m_pBtnPattern->SetClickHdl( aLk ); -- cgit