fixed incorrect handling of end iterator in HtmlizeLinebreaks() introduced in r53298 (patch #1956966)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53443 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -33,16 +33,19 @@ static wxString LINKAGEMODE HtmlizeLinebreaks(const wxString& str)
|
|||||||
wxString out;
|
wxString out;
|
||||||
out.reserve(str.length()); // we'll certainly need at least that
|
out.reserve(str.length()); // we'll certainly need at least that
|
||||||
|
|
||||||
for ( wxString::const_iterator i = str.begin(); i != str.end(); ++i )
|
const wxString::const_iterator end = str.end();
|
||||||
|
for ( wxString::const_iterator i = str.begin(); i != end; ++i )
|
||||||
{
|
{
|
||||||
switch ( (*i).GetValue() )
|
switch ( (*i).GetValue() )
|
||||||
{
|
{
|
||||||
case '<':
|
case '<':
|
||||||
while ( i != str.end() && *i != '>')
|
while ( i != end && *i != '>' )
|
||||||
{
|
{
|
||||||
out << *i++;
|
out << *i++;
|
||||||
}
|
}
|
||||||
out << '>';
|
out << '>';
|
||||||
|
if ( i == end )
|
||||||
|
return out;
|
||||||
break;
|
break;
|
||||||
case '\n':
|
case '\n':
|
||||||
out << "<br>";
|
out << "<br>";
|
||||||
@@ -52,6 +55,7 @@ static wxString LINKAGEMODE HtmlizeLinebreaks(const wxString& str)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user