X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/92a4e4de68d3bcc812c01b853c1a8d0f6ddadab6..cc8cc54f8308660af5730d8c3da5ba4710dc0dbb:/src/generic/listctrl.cpp?ds=sidebyside diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 00af514ac0..066e416df9 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2105,7 +2105,7 @@ void wxListTextCtrl::OnKeyUp( wxKeyEvent &event ) sx = parentSize.x - myPos.x; if (mySize.x > sx) sx = mySize.x; - SetSize(sx, wxDefaultSize.y); + SetSize(sx, wxDefaultCoord); event.Skip(); } @@ -4320,10 +4320,12 @@ 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") ); + int count = GetItemCount(); + 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;