Fix selection in virtual generic wxDataViewCtrl after deleting items.

The number of items managed by selection was first decremented by our own
UpdateCount() and then, again, by an explicit call to wxSelectionStore::
OnItemDelete(), which resulted in the selection ending up in an invalid state.

Fix this by not calling UpdateCount(), and hence wxSelectionStore::
SetItemCount(), at all, just OnItemDelete() is enough.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78363 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2015-01-11 22:49:15 +00:00
parent 606838b515
commit 87a44937ff

View File

@ -2385,7 +2385,7 @@ bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent,
{
wxDataViewVirtualListModel *list_model =
(wxDataViewVirtualListModel*) GetModel();
UpdateCount(list_model->GetCount());
m_count = list_model->GetCount();
m_selection.OnItemDelete(GetRowByItem(item));
}