Make wxDataViewCtrl::Expand() expand ancestors in native ports too

Expand() called ExpandAncestors() in the generic wxDataViewCtrl implementation
but not in the native ones, resulting in observable difference in the
behaviour: for example, the wxDataViewTreeCtrl in the dataview sample appeared
initially expanded under MSW, using the generic version, but collapsed under
GTK and OSX.

Harmonize this among all ports. This also has a nice side effect of making
Expand() less horribly inefficient as it is not recursively called by
ExpandAncestors() which it itself used to call: now ExpandAncestors() only
calls DoExpand() which is a simple function that only expands the item passed
to it and does nothing else.

Closes #14803.
This commit is contained in:
Vadim Zeitlin
2016-03-22 21:22:36 +01:00
parent aa9e7d3326
commit 716dace3d6
12 changed files with 30 additions and 14 deletions

View File

@@ -5273,10 +5273,8 @@ int wxDataViewCtrl::GetRowByItem( const wxDataViewItem & item ) const
return m_clientArea->GetRowByItem( item );
}
void wxDataViewCtrl::Expand( const wxDataViewItem & item )
void wxDataViewCtrl::DoExpand( const wxDataViewItem & item )
{
ExpandAncestors( item );
int row = m_clientArea->GetRowByItem( item );
if (row != -1)
m_clientArea->Expand(row);