From: Vadim Zeitlin Date: Fri, 25 Dec 1998 00:34:23 +0000 (+0000) Subject: wxStringList::Sort() bug corrected X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9257d0b705e4d331dfea6481cf577dbb350cd597?hp=fdd8d7b53897d09dddb698bc7d6cadf7372721fd wxStringList::Sort() bug corrected git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/list.cpp b/src/common/list.cpp index b11a21e816..a98385159d 100644 --- a/src/common/list.cpp +++ b/src/common/list.cpp @@ -628,11 +628,11 @@ void wxStringList::Sort() } qsort (array, N, sizeof (char *), wx_comparestrings); - Clear(); - for (i = 0; i < N; i++) - Append (array[i]); + i = 0; + for ( node = GetFirst(); node; node = node->GetNext() ) + node->SetData( array[i++] ); - delete[]array; + delete [] array; }