git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30295
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void wxListBox::SetSelection(int N, bool select)
{
void wxListBox::SetSelection(int N, bool select)
{
- if ( N == wxNOT_FOUND )
- {
- // unselect everything
- int sel = MacGetSelection() ;
- if ( sel != wxNOT_FOUND )
- {
- UInt32 id = sel + 1 ;
- verify_noerr(
- m_peer->SetSelectedItems( 1 , & id , kDataBrowserItemsRemove )
- );
- }
-
- return;
- }
-
- wxCHECK_RET( N >= 0 && N < m_noItems,
+ wxCHECK_RET( N == wxNOT_FOUND || (N >= 0 && N < m_noItems) ,
wxT("invalid index in wxListBox::SetSelection") );
if ( N == wxNOT_FOUND )
wxT("invalid index in wxListBox::SetSelection") );
if ( N == wxNOT_FOUND )