X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f7273ce09a154c443c2f5136e588d6f6c5ba7d8e..10793ebfbb49d48e6a97f8e2d02081f458bd80b4:/src/msw/wince/checklst.cpp diff --git a/src/msw/wince/checklst.cpp b/src/msw/wince/checklst.cpp index b7310d586f..56b519b537 100644 --- a/src/msw/wince/checklst.cpp +++ b/src/msw/wince/checklst.cpp @@ -286,9 +286,18 @@ wxClientData* wxCheckListBox::DoGetItemClientObject(int n) const void wxCheckListBox::DoInsertItems(const wxArrayString& items, int pos) { + wxCHECK_RET( pos >= 0 && pos <= GetCount(), + wxT("invalid index in wxListBox::InsertItems") ); + for( size_t i = 0; i < items.GetCount(); i++ ) { - Insert(items[i],pos+i); + LVITEM newItem; + wxZeroMemory(newItem); + newItem.iItem = i+pos; + int ret = ListView_InsertItem( (HWND)GetHWND(), & newItem ); + wxASSERT_MSG( int(i+pos) == ret , _T("Item not added") ); + SetString( ret , items[i] ); + m_itemsClientData.Insert(NULL, ret); } }