diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-06 16:30:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-07 07:38:36 +0100 |
commit | 9afd48075fafda24d554d17ca4a31e98e3f6be35 (patch) | |
tree | abaddc93ddd70c40bdf482d6889ad0f3e9c0e6b4 /vcl | |
parent | 38187ec15b6cbaedcadcbd8f3bcb632a5c6be88f (diff) |
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.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/treelist/treelist.cxx | 38 |
1 files changed, 19 insertions, 19 deletions
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; |