heightTextTotal = 0, heightLineDefault = 0, heightLine = 0;
wxString curLine;
- for ( const wxChar *pc = text; ; pc++ )
+ for ( wxString::const_iterator pc = text.begin(); ; ++pc )
{
- if ( *pc == _T('\n') || *pc == _T('\0') )
+ if ( pc == text.end() || *pc == _T('\n') )
{
if ( curLine.empty() )
{
heightTextTotal += heightLine;
}
- if ( *pc == _T('\n') )
+ if ( pc == text.end() )
{
- curLine.clear();
+ break;
}
- else
+ else // '\n'
{
- // the end of string
- break;
+ curLine.clear();
}
}
else