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())
|
if (!node->HasChildren())
|
||||||
return;
|
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 (!node->IsOpen())
|
||||||
{
|
{
|
||||||
if ( !SendExpanderEvent(wxEVT_DATAVIEW_ITEM_EXPANDING, node->GetItem()) )
|
if ( !SendExpanderEvent(wxEVT_DATAVIEW_ITEM_EXPANDING, node->GetItem()) )
|
||||||
@@ -3934,6 +3927,13 @@ void wxDataViewMainWindow::Expand( unsigned int row )
|
|||||||
return;
|
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);
|
node->ToggleOpen(this);
|
||||||
|
|
||||||
// build the children of current node
|
// build the children of current node
|
||||||
|
Reference in New Issue
Block a user