include/vcl/treelist.hxx | 11 +++-------- vcl/source/treelist/treelist.cxx | 38 +++++++++++++++++++------------------- 2 files changed, 22 insertions(+), 27 deletions(-)
New commits: commit 9afd48075fafda24d554d17ca4a31e98e3f6be35 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Dec 6 16:30:36 2018 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Dec 7 07:38:36 2018 +0100 move a couple of method from SvTreeList to SvListView where they really want to be anyway, instead of passing "this" as a pointer into them Change-Id: Id2a3824c4603a10a7387b6e5afd21d26da121ce4 Reviewed-on: https://gerrit.libreoffice.org/64714 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/vcl/treelist.hxx b/include/vcl/treelist.hxx index fb2aa3333adc..48fb5cb26c82 100644 --- a/include/vcl/treelist.hxx +++ b/include/vcl/treelist.hxx @@ -234,14 +234,9 @@ class VCL_DLLPUBLIC SvListView protected: SvTreeList* pModel; - void ExpandListEntry( SvTreeListEntry* pParent ) - { SvTreeList::Expand(this,pParent); } - - void CollapseListEntry( SvTreeListEntry* pParent ) - { SvTreeList::Collapse(this,pParent); } - - bool SelectListEntry( SvTreeListEntry* pEntry, bool bSelect ) - { return SvTreeList::Select(this,pEntry,bSelect); } + void ExpandListEntry( SvTreeListEntry* pParent ); + void CollapseListEntry( SvTreeListEntry* pParent ); + bool SelectListEntry( SvTreeListEntry* pEntry, bool bSelect ); public: SvListView(); // Sets the Model to 0 diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx index cc5297111c78..cafccba11c13 100644 --- a/vcl/source/treelist/treelist.cxx +++ b/vcl/source/treelist/treelist.cxx @@ -893,48 +893,48 @@ void SvTreeList::SetAbsolutePositions() bAbsPositionsValid = true; } -void SvTreeList::Expand( SvListView* pView, SvTreeListEntry* pEntry ) +void SvListView::ExpandListEntry( SvTreeListEntry* pEntry ) { - DBG_ASSERT(pEntry&&pView,"Expand:View/Entry?"); - if ( pView->IsExpanded(pEntry) ) + DBG_ASSERT(pEntry,"Expand:View/Entry?"); + if ( IsExpanded(pEntry) ) return; DBG_ASSERT(!pEntry->m_Children.empty(), "SvTreeList::Expand: We expected to have child entries."); - SvViewDataEntry* pViewData = pView->GetViewData(pEntry); + SvViewDataEntry* pViewData = GetViewData(pEntry); pViewData->SetExpanded(true); SvTreeListEntry* pParent = pEntry->pParent; // if parent is visible, invalidate status data - if ( pView->IsExpanded( pParent ) ) + if ( IsExpanded( pParent ) ) { - pView->m_pImpl->m_bVisPositionsValid = false; - pView->m_pImpl->m_nVisibleCount = 0; + m_pImpl->m_bVisPositionsValid = false; + m_pImpl->m_nVisibleCount = 0; } } -void SvTreeList::Collapse( SvListView* pView, SvTreeListEntry* pEntry ) +void SvListView::CollapseListEntry( SvTreeListEntry* pEntry ) { - DBG_ASSERT(pView&&pEntry,"Collapse:View/Entry?"); - if ( !pView->IsExpanded(pEntry) ) + DBG_ASSERT(pEntry,"Collapse:View/Entry?"); + if ( !IsExpanded(pEntry) ) return; DBG_ASSERT(!pEntry->m_Children.empty(), "SvTreeList::Collapse: We expected to have child entries."); - SvViewDataEntry* pViewData = pView->GetViewData( pEntry ); + SvViewDataEntry* pViewData = GetViewData( pEntry ); pViewData->SetExpanded(false); SvTreeListEntry* pParent = pEntry->pParent; - if ( pView->IsExpanded(pParent) ) + if ( IsExpanded(pParent) ) { - pView->m_pImpl->m_nVisibleCount = 0; - pView->m_pImpl->m_bVisPositionsValid = false; + m_pImpl->m_nVisibleCount = 0; + m_pImpl->m_bVisPositionsValid = false; } } -bool SvTreeList::Select( SvListView* pView, SvTreeListEntry* pEntry, bool bSelect ) +bool SvListView::SelectListEntry( SvTreeListEntry* pEntry, bool bSelect ) { - DBG_ASSERT(pView&&pEntry,"Select:View/Entry?"); - SvViewDataEntry* pViewData = pView->GetViewData( pEntry ); + DBG_ASSERT(pEntry,"Select:View/Entry?"); + SvViewDataEntry* pViewData = GetViewData( pEntry ); if ( bSelect ) { if ( pViewData->IsSelected() || !pViewData->IsSelectable() ) @@ -942,7 +942,7 @@ bool SvTreeList::Select( SvListView* pView, SvTreeListEntry* pEntry, bool bSelec else { pViewData->SetSelected(true); - pView->m_pImpl->m_nSelectionCount++; + m_pImpl->m_nSelectionCount++; } } else @@ -952,7 +952,7 @@ bool SvTreeList::Select( SvListView* pView, SvTreeListEntry* pEntry, bool bSelec else { pViewData->SetSelected(false); - pView->m_pImpl->m_nSelectionCount--; + m_pImpl->m_nSelectionCount--; } } return true; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits