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/trunk@26736 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
143d08f8f4
commit
781bdbb410
@ -572,10 +572,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 )
|
||||
{
|
||||
@ -586,6 +582,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
|
||||
|
Loading…
Reference in New Issue
Block a user