git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1184
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxNode *Add(const char *s)
{ return (wxNode *)wxStringListBase::Append(copystring(s)); }
- void Delete(const char *s)
- { wxStringListBase::DeleteObject((char *)s); }
+ bool Delete(const char *s);
char **ListToArray(bool new_copies = FALSE) const;
bool Member(const char *s) const;
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!