From 87a44937ff004f3c6545263b764cda3a444c1aa0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 11 Jan 2015 22:49:15 +0000 Subject: [PATCH] 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 --- src/generic/datavgen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index d4e0d100a9..12b5b0bf14 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -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)); }