From 9afd48075fafda24d554d17ca4a31e98e3f6be35 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 6 Dec 2018 16:30:36 +0200 Subject: 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 --- vcl/source/treelist/treelist.cxx | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'vcl') 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; -- cgit