]> git.saurik.com Git - wxWidgets.git/commitdiff
Allow any too-large index to mean Append, just like on MSW.
authorRobin Dunn <robin@alldunn.com>
Fri, 16 Jul 2004 20:29:17 +0000 (20:29 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 16 Jul 2004 20:29:17 +0000 (20:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28267 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/listctrl.cpp

index 00af514ac06f27aeeb3fd9ca835d40d13cf22b33..4e3588f7e3b218d94d9bf2d28dfd1e43d93b771c 100644 (file)
@@ -4321,9 +4321,11 @@ void wxListMainWindow::InsertItem( wxListItem &item )
     wxASSERT_MSG( !IsVirtual(), _T("can't be used with virtual control") );
 
     size_t count = GetItemCount();
-    wxCHECK_RET( item.m_itemId >= 0 && (size_t)item.m_itemId <= count,
-                 _T("invalid item index") );
+    wxCHECK_RET( item.m_itemId >= 0, _T("invalid item index") );
 
+    if (item.m_itemId > count)
+        item.m_itemId = count;
+    
     size_t id = item.m_itemId;
 
     m_dirty = true;