From 781bdbb410f421a1c93655217f8729160b6f4aa5 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 13 Apr 2004 10:29:55 +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/trunk@26736 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 1ed58c7709..d4ca4c4c87 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -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 -- 2.47.2