}
}
-// wxFAIL_MSG( "invalid index in wxListBase::Item" );
+ wxFAIL_MSG( "invalid index in wxListBase::Item" );
return (wxNodeBase *)NULL;
}
return FALSE;
}
-
void wxListBase::Clear()
{
wxNodeBase *current = m_nodeFirst;
delete [] (char *)GetData();
}
+bool wxStringList::Delete(const char *s)
+{
+ wxStringListNode *current;
+
+ for ( current = GetFirst(); current; current = current->GetNext() )
+ {
+ if ( strcmp(current->GetData(), s) == 0 )
+ {
+ DeleteNode(current);
+ return TRUE;
+ }
+ }
+
+ // not found
+ return FALSE;
+}
+
void wxStringList::DoCopy(const wxStringList& other)
{
wxASSERT( GetCount() == 0 ); // this list must be empty before copying!
}
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;
}