From ca21a4e72927167815450b77155ec31fae590115 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 9 Jul 2009 18:26:47 +0000 Subject: [PATCH] Reduce size of virtual list before sending out delete notification, fixes #10966: wxDataViewVirtualListModel row deletion bug git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/datavcmn.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index b54ad1982f..0e15715959 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -535,13 +535,15 @@ void wxDataViewVirtualListModel::RowAppended() void wxDataViewVirtualListModel::RowDeleted( unsigned int row ) { + m_size--; wxDataViewItem item( wxUIntToPtr(row+1) ); wxDataViewModel::ItemDeleted( wxDataViewItem(0), item ); - m_size--; } void wxDataViewVirtualListModel::RowsDeleted( const wxArrayInt &rows ) { + m_size -= rows.GetCount(); + wxArrayInt sorted = rows; sorted.Sort( my_sort ); @@ -553,8 +555,6 @@ void wxDataViewVirtualListModel::RowsDeleted( const wxArrayInt &rows ) array.Add( item ); } wxDataViewModel::ItemsDeleted( wxDataViewItem(0), array ); - - m_size -= rows.GetCount(); } void wxDataViewVirtualListModel::RowChanged( unsigned int row ) -- 2.50.0