Kaydet (Commit) 9afd4807 authored tarafından Noel Grandin's avatar Noel Grandin

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: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 38187ec1
...@@ -234,14 +234,9 @@ class VCL_DLLPUBLIC SvListView ...@@ -234,14 +234,9 @@ class VCL_DLLPUBLIC SvListView
protected: protected:
SvTreeList* pModel; SvTreeList* pModel;
void ExpandListEntry( SvTreeListEntry* pParent ) void ExpandListEntry( SvTreeListEntry* pParent );
{ SvTreeList::Expand(this,pParent); } void CollapseListEntry( SvTreeListEntry* pParent );
bool SelectListEntry( SvTreeListEntry* pEntry, bool bSelect );
void CollapseListEntry( SvTreeListEntry* pParent )
{ SvTreeList::Collapse(this,pParent); }
bool SelectListEntry( SvTreeListEntry* pEntry, bool bSelect )
{ return SvTreeList::Select(this,pEntry,bSelect); }
public: public:
SvListView(); // Sets the Model to 0 SvListView(); // Sets the Model to 0
......
...@@ -893,48 +893,48 @@ void SvTreeList::SetAbsolutePositions() ...@@ -893,48 +893,48 @@ void SvTreeList::SetAbsolutePositions()
bAbsPositionsValid = true; bAbsPositionsValid = true;
} }
void SvTreeList::Expand( SvListView* pView, SvTreeListEntry* pEntry ) void SvListView::ExpandListEntry( SvTreeListEntry* pEntry )
{ {
DBG_ASSERT(pEntry&&pView,"Expand:View/Entry?"); DBG_ASSERT(pEntry,"Expand:View/Entry?");
if ( pView->IsExpanded(pEntry) ) if ( IsExpanded(pEntry) )
return; return;
DBG_ASSERT(!pEntry->m_Children.empty(), "SvTreeList::Expand: We expected to have child entries."); 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); pViewData->SetExpanded(true);
SvTreeListEntry* pParent = pEntry->pParent; SvTreeListEntry* pParent = pEntry->pParent;
// if parent is visible, invalidate status data // if parent is visible, invalidate status data
if ( pView->IsExpanded( pParent ) ) if ( IsExpanded( pParent ) )
{ {
pView->m_pImpl->m_bVisPositionsValid = false; m_pImpl->m_bVisPositionsValid = false;
pView->m_pImpl->m_nVisibleCount = 0; m_pImpl->m_nVisibleCount = 0;
} }
} }
void SvTreeList::Collapse( SvListView* pView, SvTreeListEntry* pEntry ) void SvListView::CollapseListEntry( SvTreeListEntry* pEntry )
{ {
DBG_ASSERT(pView&&pEntry,"Collapse:View/Entry?"); DBG_ASSERT(pEntry,"Collapse:View/Entry?");
if ( !pView->IsExpanded(pEntry) ) if ( !IsExpanded(pEntry) )
return; return;
DBG_ASSERT(!pEntry->m_Children.empty(), "SvTreeList::Collapse: We expected to have child entries."); 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); pViewData->SetExpanded(false);
SvTreeListEntry* pParent = pEntry->pParent; SvTreeListEntry* pParent = pEntry->pParent;
if ( pView->IsExpanded(pParent) ) if ( IsExpanded(pParent) )
{ {
pView->m_pImpl->m_nVisibleCount = 0; m_pImpl->m_nVisibleCount = 0;
pView->m_pImpl->m_bVisPositionsValid = false; 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?"); DBG_ASSERT(pEntry,"Select:View/Entry?");
SvViewDataEntry* pViewData = pView->GetViewData( pEntry ); SvViewDataEntry* pViewData = GetViewData( pEntry );
if ( bSelect ) if ( bSelect )
{ {
if ( pViewData->IsSelected() || !pViewData->IsSelectable() ) if ( pViewData->IsSelected() || !pViewData->IsSelectable() )
...@@ -942,7 +942,7 @@ bool SvTreeList::Select( SvListView* pView, SvTreeListEntry* pEntry, bool bSelec ...@@ -942,7 +942,7 @@ bool SvTreeList::Select( SvListView* pView, SvTreeListEntry* pEntry, bool bSelec
else else
{ {
pViewData->SetSelected(true); pViewData->SetSelected(true);
pView->m_pImpl->m_nSelectionCount++; m_pImpl->m_nSelectionCount++;
} }
} }
else else
...@@ -952,7 +952,7 @@ bool SvTreeList::Select( SvListView* pView, SvTreeListEntry* pEntry, bool bSelec ...@@ -952,7 +952,7 @@ bool SvTreeList::Select( SvListView* pView, SvTreeListEntry* pEntry, bool bSelec
else else
{ {
pViewData->SetSelected(false); pViewData->SetSelected(false);
pView->m_pImpl->m_nSelectionCount--; m_pImpl->m_nSelectionCount--;
} }
} }
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment