Only call Select within SetString when internal data has been restored,

else assert results if the item was selected


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@26747 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2004-04-13 12:51:13 +00:00
parent 4441ece149
commit f7780364d6

View File

@@ -555,10 +555,6 @@ void wxListBox::SetString(int N, const wxString& s)
else if ( oldObjData )
SetClientObject(N, oldObjData);
// we may have lost the selection
if ( wasSelected )
Select(N);
#if wxUSE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW )
{
@@ -569,6 +565,10 @@ void wxListBox::SetString(int N, const wxString& s)
ListBox_SetItemData(GetHwnd(), N, m_aItems[N]);
}
#endif //USE_OWNER_DRAWN
// we may have lost the selection
if ( wasSelected )
Select(N);
}
int wxListBox::GetCount() const