diff options
author | Noel Grandin <noel@peralex.com> | 2015-08-31 14:34:51 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-09-04 13:08:30 +0200 |
commit | ed7ea6885400d62c84304917493ded4ba376c361 (patch) | |
tree | aff4993be940f764817737f938fa20ff0f0a26fd /svtools | |
parent | 2ec22477739d2c075e7d9997c3e90cb1a512f63f (diff) |
convert Link<> to typed
Change-Id: I42eba6c9b6295d94dddc49942d47d59f474bfd28
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/simptabl.cxx | 8 | ||||
-rw-r--r-- | svtools/source/contnr/treelist.cxx | 4 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 25 |
3 files changed, 14 insertions, 23 deletions
diff --git a/svtools/source/contnr/simptabl.cxx b/svtools/source/contnr/simptabl.cxx index 16a16bbfeaa9..de1c3acde1a3 100644 --- a/svtools/source/contnr/simptabl.cxx +++ b/svtools/source/contnr/simptabl.cxx @@ -462,11 +462,11 @@ sal_Int32 SvSimpleTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRig return nCompare; } -IMPL_LINK( SvSimpleTable, CompareHdl, SvSortData*, pData) +IMPL_LINK_TYPED( SvSimpleTable, CompareHdl, const SvSortData&, rData, sal_Int32) { - SvTreeListEntry* pLeft = const_cast<SvTreeListEntry*>(pData->pLeft); - SvTreeListEntry* pRight = const_cast<SvTreeListEntry*>(pData->pRight); - return (long) ColCompare(pLeft,pRight); + SvTreeListEntry* pLeft = const_cast<SvTreeListEntry*>(rData.pLeft); + SvTreeListEntry* pRight = const_cast<SvTreeListEntry*>(rData.pRight); + return ColCompare(pLeft,pRight); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx index 27520b14322d..231baec4d912 100644 --- a/svtools/source/contnr/treelist.cxx +++ b/svtools/source/contnr/treelist.cxx @@ -389,7 +389,7 @@ void SvTreeList::InsertTree(SvTreeListEntry* pSrcEntry, SvTreeListEntry* SvTreeList::CloneEntry( SvTreeListEntry* pSource ) const { if( aCloneLink.IsSet() ) - return reinterpret_cast<SvTreeListEntry*>(aCloneLink.Call( pSource )); + return aCloneLink.Call( pSource ); SvTreeListEntry* pEntry = CreateEntry(); pEntry->Clone(pSource); return pEntry; @@ -1539,7 +1539,7 @@ sal_Int32 SvTreeList::Compare(const SvTreeListEntry* pLeft, const SvTreeListEntr SvSortData aSortData; aSortData.pLeft = pLeft; aSortData.pRight = pRight; - return aCompareLink.Call( &aSortData ); + return aCompareLink.Call( aSortData ); } return 0; } diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 3926371cd89d..e2b496b79412 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -359,8 +359,6 @@ struct SvTreeListBoxImpl bool m_bEntryMnemonicsEnabled:1; bool m_bDoingQuickSelection:1; - Link<>* m_pLink; - vcl::MnemonicEngine m_aMnemonicEngine; vcl::QuickSelectionEngine m_aQuickSelectionEngine; @@ -368,7 +366,6 @@ struct SvTreeListBoxImpl m_bIsEmptyTextAllowed(true), m_bEntryMnemonicsEnabled(false), m_bDoingQuickSelection(false), - m_pLink(NULL), m_aMnemonicEngine(_rBox), m_aQuickSelectionEngine(_rBox) {} }; @@ -464,9 +461,9 @@ bool SvTreeListBox::IsEntryMnemonicsEnabled() const return mpImpl->m_bEntryMnemonicsEnabled; } -IMPL_LINK( SvTreeListBox, CloneHdl_Impl, SvTreeListEntry*, pEntry ) +IMPL_LINK_TYPED( SvTreeListBox, CloneHdl_Impl, SvTreeListEntry*, pEntry, SvTreeListEntry* ) { - return reinterpret_cast<sal_IntPtr>(CloneEntry(pEntry)); + return CloneEntry(pEntry); } sal_uLong SvTreeListBox::Insert( SvTreeListEntry* pEntry, SvTreeListEntry* pParent, sal_uLong nPos ) @@ -630,7 +627,7 @@ bool SvTreeListBox::CopySelection( SvTreeListBox* pSource, SvTreeListEntry* pTar bool bSuccess = true; std::vector<SvTreeListEntry*> aList; bool bClone = ( pSource->GetModel() != GetModel() ); - Link<> aCloneLink( pModel->GetCloneLink() ); + Link<SvTreeListEntry*,SvTreeListEntry*> aCloneLink( pModel->GetCloneLink() ); pModel->SetCloneLink( LINK(this, SvTreeListBox, CloneHdl_Impl )); // cache selection to simplify iterating over the selection when doing a D&D @@ -687,7 +684,7 @@ bool SvTreeListBox::MoveSelectionCopyFallbackPossible( SvTreeListBox* pSource, S bool bSuccess = true; std::vector<SvTreeListEntry*> aList; bool bClone = ( pSource->GetModel() != GetModel() ); - Link<> aCloneLink( pModel->GetCloneLink() ); + Link<SvTreeListEntry*,SvTreeListEntry*> aCloneLink( pModel->GetCloneLink() ); if ( bClone ) pModel->SetCloneLink( LINK(this, SvTreeListBox, CloneHdl_Impl )); @@ -1411,9 +1408,6 @@ void SvTreeListBox::InitTreeView() nAllItemAccRoleType = SvTreeAccRoleType::NONE; mnCheckboxItemWidth = 0; - Link<>* pLink = new Link<>( LINK(this,SvTreeListBox, DefaultCompare) ); - mpImpl->m_pLink = pLink; - nTreeFlags = SvTreeFlags::RECALCTABS; nIndent = SV_LBOX_DEFAULT_INDENT_PIXEL; nEntryHeightOffs = SV_ENTRYHEIGHTOFFS_PIXEL; @@ -1519,9 +1513,6 @@ void SvTreeListBox::dispose() } if( mpImpl ) { - delete mpImpl->m_pLink; - mpImpl->m_pLink = NULL; - ClearTabList(); delete pEdCtrl; @@ -2821,7 +2812,7 @@ void SvTreeListBox::ImplInitStyle() else { GetModel()->SetSortMode(SortNone); - GetModel()->SetCompareHdl(Link<>()); + GetModel()->SetCompareHdl(Link<const SvSortData&,sal_Int32>()); } pImp->SetStyle(nWindowStyle); pImp->Resize(); @@ -3602,10 +3593,10 @@ void SvTreeListBox::RequestHelp( const HelpEvent& rHEvt ) Control::RequestHelp( rHEvt ); } -IMPL_LINK( SvTreeListBox, DefaultCompare, SvSortData*, pData ) +IMPL_LINK_TYPED( SvTreeListBox, DefaultCompare, const SvSortData&, rData, sal_Int32 ) { - const SvTreeListEntry* pLeft = pData->pLeft; - const SvTreeListEntry* pRight = pData->pRight; + const SvTreeListEntry* pLeft = rData.pLeft; + const SvTreeListEntry* pRight = rData.pRight; OUString aLeft( static_cast<const SvLBoxString*>(pLeft->GetFirstItem(SV_ITEM_ID_LBOXSTRING))->GetText()); OUString aRight( static_cast<const SvLBoxString*>(pRight->GetFirstItem(SV_ITEM_ID_LBOXSTRING))->GetText()); pImp->UpdateStringSorter(); |