Use wxUniChar instead of wxChar for operations with wxString iterators.

This commit is contained in:
Artur Wieczorek 2015-06-29 20:06:27 +02:00
parent d9acff9cd8
commit de38b5da25
2 changed files with 14 additions and 15 deletions

View File

@ -1803,12 +1803,12 @@ wxString& wxPropertyGrid::CreateEscapeSequences( wxString& dst_str, wxString& sr
return dst_str;
}
wxString::const_iterator i = src_str.begin();
wxString::const_iterator i;
wxUniChar prev_a = wxS('\0');
for ( ; i != src_str.end(); ++i )
for ( i = src_str.begin(); i != src_str.end(); ++i )
{
wxChar a = *i;
wxUniChar a = *i;
if ( a >= wxS(' ') )
{
@ -6174,14 +6174,13 @@ bool wxPGStringTokenizer::HasMoreTokens()
wxString::const_iterator i = m_curPos;
wxUniChar delim = m_delimiter;
wxUniChar a;
wxUniChar prev_a = wxS('\0');
bool inToken = false;
while ( i != str.end() )
{
a = *i;
wxUniChar a = *i;
if ( !inToken )
{
@ -6522,19 +6521,19 @@ wxPGChoices wxPropertyGridPopulator::ParseChoices( const wxString& choicesString
if ( !found )
{
// Parse choices string
wxString::const_iterator it = choicesString.begin();
wxString::const_iterator it;
wxString label;
wxString value;
int state = 0;
bool labelValid = false;
for ( ; it != choicesString.end(); ++it )
for ( it = choicesString.begin(); it != choicesString.end(); ++it )
{
wxChar c = *it;
wxUniChar c = *it;
if ( state != 1 )
{
if ( c == wxT('"') )
if ( c == wxS('"') )
{
if ( labelValid )
{
@ -6548,21 +6547,21 @@ wxPGChoices wxPropertyGridPopulator::ParseChoices( const wxString& choicesString
label.clear();
state = 1;
}
else if ( c == wxT('=') )
else if ( c == wxS('=') )
{
if ( labelValid )
{
state = 2;
}
}
else if ( state == 2 && (wxIsalnum(c) || c == wxT('x')) )
else if ( state == 2 && (wxIsalnum(c) || c == wxS('x')) )
{
value << c;
}
}
else
{
if ( c == wxT('"') )
if ( c == wxS('"') )
{
state = 0;
labelValid = true;

View File

@ -119,7 +119,7 @@ wxString wxStringProperty::ValueToString( wxVariant& value,
// If string is password and value is for visual purposes,
// then return asterisks instead the actual string.
if ( (m_flags & wxPG_PROP_PASSWORD) && !(argFlags & (wxPG_FULL_VALUE|wxPG_EDITABLE_VALUE)) )
return wxString(wxChar('*'), s.Length());
return wxString(wxS('*'), s.Length());
return s;
}
@ -279,7 +279,7 @@ bool wxIntProperty::StringToValue( wxVariant& variant, const wxString& text, int
for ( ; i != iMax; ++i )
{
wxChar c = *i;
wxUniChar c = *i;
if ( c != wxS('0') && c != wxS(' ') )
break;
firstNonZeroPos++;
@ -879,7 +879,7 @@ const wxString& wxPropertyGrid::DoubleToString(wxString& target,
new_len--;
}
wxChar cur_char = *i;
wxUniChar cur_char = *i;
if ( cur_char != wxS('.') && cur_char != wxS(',') )
new_len++;