Iterate over all characters of a wxString with iterator

This commit is contained in:
Artur Wieczorek
2018-11-07 22:12:55 +01:00
parent 3d18e1a2b4
commit 9e378480c2

View File

@@ -896,15 +896,16 @@ wxPGVIterator wxPropertyGridInterface::GetVIterator( int flags ) const
static wxString EscapeDelimiters(const wxString& s)
{
wxString result;
result.Alloc(s.length());
const wxChar* ch = s.c_str();
while (*ch)
result.reserve(s.length());
for (wxString::const_iterator it = s.begin(); it != s.end(); ++it)
{
if (*ch == wxT(';') || *ch == wxT('|') || *ch == wxT(','))
result += wxT('\\');
result += *ch;
++ch;
wxStringCharType ch = *it;
if ( ch == wxS(';') || ch == wxS('|') || ch == wxS(',') )
result += wxS('\\');
result += ch;
}
return result;
}