Handle cases where an index larger than GetItemCount() is passed into InsertItem.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1024,6 +1024,11 @@ long wxListCtrl::InsertItem(wxListItem& info)
|
||||
return m_genericImpl->InsertItem(info);
|
||||
|
||||
if (m_dbImpl){
|
||||
int count = GetItemCount();
|
||||
|
||||
if (info.m_itemId > count)
|
||||
info.m_itemId = count;
|
||||
|
||||
m_dbImpl->MacInsertItem(info.m_itemId, &info );
|
||||
wxListEvent event( wxEVT_COMMAND_LIST_INSERT_ITEM, GetId() );
|
||||
event.SetEventObject( this );
|
||||
|
Reference in New Issue
Block a user