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 /editeng/source/outliner | |
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 'editeng/source/outliner')
-rw-r--r-- | editeng/source/outliner/outleeng.hxx | 2 | ||||
-rw-r--r-- | editeng/source/outliner/outlin2.cxx | 12 | ||||
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 8 | ||||
-rw-r--r-- | editeng/source/outliner/outlvw.cxx | 2 | ||||
-rw-r--r-- | editeng/source/outliner/paralist.hxx | 6 |
5 files changed, 15 insertions, 15 deletions
diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx index a802eedf1fb8..09eebfacf62e 100644 --- a/editeng/source/outliner/outleeng.hxx +++ b/editeng/source/outliner/outleeng.hxx @@ -81,7 +81,7 @@ public: virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) SAL_OVERRIDE; // belongs into class Outliner, move there before incompatible update! - Link aOutlinerNotifyHdl; + Link<> aOutlinerNotifyHdl; NotifyList aNotifyCache; }; diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx index 18a27e1c5826..549f6456cfc6 100644 --- a/editeng/source/outliner/outlin2.cxx +++ b/editeng/source/outliner/outlin2.cxx @@ -108,33 +108,33 @@ sal_uLong Outliner::GetTextHeight() const return pEditEngine->GetTextHeight(); } -void Outliner::SetModifyHdl( const Link& rLink ) +void Outliner::SetModifyHdl( const Link<>& rLink ) { pEditEngine->SetModifyHdl( rLink ); } -Link Outliner::GetModifyHdl() const +Link<> Outliner::GetModifyHdl() const { return pEditEngine->GetModifyHdl(); } -void Outliner::SetNotifyHdl( const Link& rLink ) +void Outliner::SetNotifyHdl( const Link<>& rLink ) { pEditEngine->aOutlinerNotifyHdl = rLink; if ( rLink.IsSet() ) pEditEngine->SetNotifyHdl( LINK( this, Outliner, EditEngineNotifyHdl ) ); else - pEditEngine->SetNotifyHdl( Link() ); + pEditEngine->SetNotifyHdl( Link<>() ); } -void Outliner::SetStatusEventHdl( const Link& rLink ) +void Outliner::SetStatusEventHdl( const Link<>& rLink ) { pEditEngine->SetStatusEventHdl( rLink ); } -Link Outliner::GetStatusEventHdl() const +Link<> Outliner::GetStatusEventHdl() const { return pEditEngine->GetStatusEventHdl(); } diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index cecf2b2f3f0d..8f704bb192bf 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2044,25 +2044,25 @@ IMPL_LINK( Outliner, EditEngineNotifyHdl, EENotify*, pNotify ) } /** sets a link that is called at the beginning of a drag operation at an edit view */ -void Outliner::SetBeginDropHdl( const Link& rLink ) +void Outliner::SetBeginDropHdl( const Link<>& rLink ) { pEditEngine->SetBeginDropHdl( rLink ); } /** sets a link that is called at the end of a drag operation at an edit view */ -void Outliner::SetEndDropHdl( const Link& rLink ) +void Outliner::SetEndDropHdl( const Link<>& rLink ) { pEditEngine->SetEndDropHdl( rLink ); } /** sets a link that is called before a drop or paste operation. */ -void Outliner::SetBeginPasteOrDropHdl( const Link& rLink ) +void Outliner::SetBeginPasteOrDropHdl( const Link<>& rLink ) { maBeginPasteOrDropHdl = rLink; } /** sets a link that is called after a drop or paste operation. */ -void Outliner::SetEndPasteOrDropHdl( const Link& rLink ) +void Outliner::SetEndPasteOrDropHdl( const Link<>& rLink ) { maEndPasteOrDropHdl = rLink; } diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index a41059595a5b..7e5450d7be28 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -1376,7 +1376,7 @@ bool OutlinerView::IsWrongSpelledWordAtPos( const Point& rPosPixel, bool bMarkIf return pEditView->IsWrongSpelledWordAtPos( rPosPixel, bMarkIfWrong ); } -void OutlinerView::ExecuteSpellPopup( const Point& rPosPixel, Link* pStartDlg ) +void OutlinerView::ExecuteSpellPopup( const Point& rPosPixel, Link<>* pStartDlg ) { pEditView->ExecuteSpellPopup( rPosPixel, pStartDlg ); } diff --git a/editeng/source/outliner/paralist.hxx b/editeng/source/outliner/paralist.hxx index a19e42233bdb..fb3311d8f89b 100644 --- a/editeng/source/outliner/paralist.hxx +++ b/editeng/source/outliner/paralist.hxx @@ -66,12 +66,12 @@ public: void Expand( Paragraph* pParent ); void Collapse( Paragraph* pParent ); - void SetVisibleStateChangedHdl( const Link& rLink ) { aVisibleStateChangedHdl = rLink; } - Link GetVisibleStateChangedHdl() const { return aVisibleStateChangedHdl; } + void SetVisibleStateChangedHdl( const Link<>& rLink ) { aVisibleStateChangedHdl = rLink; } + Link<> GetVisibleStateChangedHdl() const { return aVisibleStateChangedHdl; } private: - Link aVisibleStateChangedHdl; + Link<> aVisibleStateChangedHdl; std::vector<Paragraph*> maEntries; }; |