From f7780364d6f5c378c87c0684db6c83a51bb28d08 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 13 Apr 2004 12:51:13 +0000 Subject: [PATCH] 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 --- src/msw/listbox.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index a3bfc6c91b..f8ee2b9365 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -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