Remove the item from the internal representation of the model before calling
ItemDeleted() callback so that the callback sees the model in a consistent
state.
This is more consistent with the other callbacks (e.g. ItemAdded()) and other
models (e.g. wxDataViewVirtualListModel) and should fix crashes in wxOSX
version of the control.
Closes #13753.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69990
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
m_ordered = false;
wxDataViewItem item( m_hash[row] );
m_ordered = false;
wxDataViewItem item( m_hash[row] );
- /* wxDataViewModel:: */ ItemDeleted( wxDataViewItem(0), item );
+ /* wxDataViewModel:: */ ItemDeleted( wxDataViewItem(0), item );
}
void wxDataViewIndexListModel::RowsDeleted( const wxArrayInt &rows )
{
}
void wxDataViewIndexListModel::RowsDeleted( const wxArrayInt &rows )
{
- wxArrayInt sorted = rows;
- sorted.Sort( my_sort );
-
m_ordered = false;
wxDataViewItemArray array;
m_ordered = false;
wxDataViewItemArray array;
wxDataViewItem item( m_hash[rows[i]] );
array.Add( item );
}
wxDataViewItem item( m_hash[rows[i]] );
array.Add( item );
}
- /* wxDataViewModel:: */ ItemsDeleted( wxDataViewItem(0), array );
+ wxArrayInt sorted = rows;
+ sorted.Sort( my_sort );
for (i = 0; i < sorted.GetCount(); i++)
m_hash.RemoveAt( sorted[i] );
for (i = 0; i < sorted.GetCount(); i++)
m_hash.RemoveAt( sorted[i] );
+
+ /* wxDataViewModel:: */ ItemsDeleted( wxDataViewItem(0), array );
}
void wxDataViewIndexListModel::RowChanged( unsigned int row )
}
void wxDataViewIndexListModel::RowChanged( unsigned int row )