diff options
author | Noel Grandin <noel@peralex.com> | 2015-09-09 15:09:26 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-09-10 08:30:10 +0200 |
commit | 99d13c792637a4362c50b30bdc57ebbc6f3b7e4a (patch) | |
tree | 814ba2046d0e1c00f03f744d0a89629b82ab7226 /vcl | |
parent | 9c162ddbea1507193b83fea2e2310f9eda5cfdb9 (diff) |
convert Link<> to typed
Change-Id: Idcc6b760dfe2d388a2634fcc345c66ff5649a62a
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/ilstbox.hxx | 8 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 6 | ||||
-rw-r--r-- | vcl/source/control/ilstbox.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/lstbox.cxx | 4 |
4 files changed, 8 insertions, 12 deletions
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx index 5f79f70b6c90..1ff8df753575 100644 --- a/vcl/inc/ilstbox.hxx +++ b/vcl/inc/ilstbox.hxx @@ -95,7 +95,7 @@ private: sal_Int32 mnMRUCount; sal_Int32 mnMaxMRUCount; - Link<> maSelectionChangedHdl; + Link<sal_Int32,void> maSelectionChangedHdl; bool mbCallSelectionChangedHdl; boost::ptr_vector<ImplEntryType> maEntries; @@ -154,7 +154,7 @@ public: void SetSelectionAnchor( sal_Int32 nPos ) { mnSelectionAnchor = nPos; } sal_Int32 GetSelectionAnchor() const { return mnSelectionAnchor; } - void SetSelectionChangedHdl( const Link<>& rLnk ) { maSelectionChangedHdl = rLnk; } + void SetSelectionChangedHdl( const Link<sal_Int32,void>& rLnk ) { maSelectionChangedHdl = rLnk; } void SetCallSelectionChangedHdl( bool bCall ) { mbCallSelectionChangedHdl = bCall; } void SetMRUCount( sal_Int32 n ) { mnMRUCount = n; } @@ -474,13 +474,13 @@ public: void SetFocusHdl( const Link<>& rLink ) { maLBWindow->SetFocusHdl( rLink ); } void SetListItemSelectHdl( const Link<>& rLink ) { maLBWindow->SetListItemSelectHdl( rLink ); } - void SetSelectionChangedHdl( const Link<>& rLnk ) { maLBWindow->GetEntryList()->SetSelectionChangedHdl( rLnk ); } + void SetSelectionChangedHdl( const Link<sal_Int32,void>& rLnk ) { maLBWindow->GetEntryList()->SetSelectionChangedHdl( rLnk ); } void SetCallSelectionChangedHdl( bool bCall ) { maLBWindow->GetEntryList()->SetCallSelectionChangedHdl( bCall ); } bool IsSelectionChanged() const { return maLBWindow->IsSelectionChanged(); } sal_uInt16 GetSelectModifier() const { return maLBWindow->GetSelectModifier(); } void SetMRUEntries( const OUString& rEntries, sal_Unicode cSep ); - OUString GetMRUEntries( sal_Unicode cSep ) const; + OUString GetMRUEntries( sal_Unicode cSep ) const; void SetMaxMRUCount( sal_Int32 n ) { maLBWindow->GetEntryList()->SetMaxMRUCount( n ); } sal_Int32 GetMaxMRUCount() const { return maLBWindow->GetEntryList()->GetMaxMRUCount(); } sal_uInt16 GetDisplayLineCount() const diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 4de4ec97ffda..5009cdde3df9 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -83,7 +83,7 @@ struct ComboBox::Impl DECL_DLLPRIVATE_LINK( ImplCancelHdl, void* ); DECL_DLLPRIVATE_LINK( ImplDoubleClickHdl, void* ); DECL_DLLPRIVATE_LINK_TYPED( ImplPopupModeEndHdl, FloatingWindow*, void ); - DECL_DLLPRIVATE_LINK( ImplSelectionChangedHdl, void* ); + DECL_DLLPRIVATE_LINK_TYPED( ImplSelectionChangedHdl, sal_Int32, void ); DECL_DLLPRIVATE_LINK( ImplListItemSelectHdl , void* ); void ImplClickButtonHandler( ImplBtn* ); @@ -514,15 +514,13 @@ IMPL_LINK_NOARG(ComboBox::Impl, ImplCancelHdl) return 1; } -IMPL_LINK( ComboBox::Impl, ImplSelectionChangedHdl, void*, n ) +IMPL_LINK_TYPED( ComboBox::Impl, ImplSelectionChangedHdl, sal_Int32, nChanged, void ) { if (!m_pImplLB->IsTrackingSelect()) { - sal_Int32 nChanged = (sal_Int32)reinterpret_cast<sal_uLong>(n); if (!m_pSubEdit->IsReadOnly() && m_pImplLB->GetEntryList()->IsEntryPosSelected(nChanged)) m_pSubEdit->SetText(m_pImplLB->GetEntryList()->GetEntryText(nChanged)); } - return 1; } IMPL_LINK_NOARG(ComboBox::Impl, ImplDoubleClickHdl) diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index 87b17e989564..cdb82fee4114 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -94,7 +94,7 @@ void ImplEntryList::SelectEntry( sal_Int32 nPos, bool bSelect ) { iter->mbIsSelected = bSelect; if ( mbCallSelectionChangedHdl ) - maSelectionChangedHdl.Call( reinterpret_cast<void*>(nPos) ); + maSelectionChangedHdl.Call( nPos ); } } } diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index a108a537b578..3516bbb3cc4f 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -263,11 +263,10 @@ IMPL_LINK_NOARG(ListBox, ImplCancelHdl) return 1; } -IMPL_LINK( ListBox, ImplSelectionChangedHdl, void*, n ) +IMPL_LINK_TYPED( ListBox, ImplSelectionChangedHdl, sal_Int32, nChanged, void ) { if ( !mpImplLB->IsTrackingSelect() ) { - sal_Int32 nChanged = (sal_Int32)reinterpret_cast<sal_uLong>(n); const ImplEntryList* pEntryList = mpImplLB->GetEntryList(); if ( pEntryList->IsEntryPosSelected( nChanged ) ) { @@ -291,7 +290,6 @@ IMPL_LINK( ListBox, ImplSelectionChangedHdl, void*, n ) } mpImplWin->Invalidate(); } - return 1; } IMPL_LINK_NOARG(ListBox, ImplDoubleClickHdl) |