Only invalidate row height cache when a row is really expanded
It's wasteful to do it if it's already expanded or won't be expanded because the EXPANDING event is vetoed.
This commit is contained in:
@@ -3919,13 +3919,6 @@ void wxDataViewMainWindow::Expand( unsigned int row )
|
||||
if (!node->HasChildren())
|
||||
return;
|
||||
|
||||
if ( m_rowHeightCache )
|
||||
{
|
||||
// Expand makes new rows visible thus we invalidates all following
|
||||
// rows in the height cache
|
||||
m_rowHeightCache->Remove(row);
|
||||
}
|
||||
|
||||
if (!node->IsOpen())
|
||||
{
|
||||
if ( !SendExpanderEvent(wxEVT_DATAVIEW_ITEM_EXPANDING, node->GetItem()) )
|
||||
@@ -3934,6 +3927,13 @@ void wxDataViewMainWindow::Expand( unsigned int row )
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_rowHeightCache )
|
||||
{
|
||||
// Expand makes new rows visible thus we invalidates all following
|
||||
// rows in the height cache
|
||||
m_rowHeightCache->Remove(row);
|
||||
}
|
||||
|
||||
node->ToggleOpen(this);
|
||||
|
||||
// build the children of current node
|
||||
|
Reference in New Issue
Block a user