From 7e4fb3b8168f4f2dbf2f8a246d3e094a8ccba194 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 8 Mar 2005 10:37:35 +0000 Subject: [PATCH] fixed loop deleting the old filters in SetWildcard() after last commit git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32671 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/filedlgg.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index febc457bfe..638c1173f1 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -915,7 +915,7 @@ bool wxGenericFileDialog::Create( wxWindow *parent, { m_bypassGenericImpl = bypassGenericImpl; - if (!wxFileDialogBase::Create(parent, message, defaultDir, defaultFile, + if (!wxFileDialogBase::Create(parent, message, defaultDir, defaultFile, wildCard, style, pos)) { return false; @@ -1151,12 +1151,13 @@ void wxGenericFileDialog::SetWildcard(const wxString& wildCard) wildFilters); wxCHECK_RET( count, wxT("wxFileDialog: bad wildcard string") ); - size_t n, old_count = m_choice->GetCount(); - for ( n = 0; n < count; n++ ) + const size_t countOld = m_choice->GetCount(); + size_t n; + for ( n = 0; n < countOld; n++ ) { delete (wxString *)m_choice->GetClientData(n); } - + for ( n = 0; n < count; n++ ) { m_choice->Append( wildDescriptions[n], new wxString( wildFilters[n] ) );