use iterators in HtmlizeLinebreaks()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		@@ -33,15 +33,14 @@ 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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    size_t len = str.Len();
 | 
					    for ( wxString::const_iterator i = str.begin(); i != str.end(); ++i )
 | 
				
			||||||
    for (size_t i = 0; i < len; i++)
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        switch ( str[i].GetValue() )
 | 
					        switch ( (*i).GetValue() )
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            case '<':
 | 
					            case '<':
 | 
				
			||||||
                while (i < len && str[i] != '>')
 | 
					                while ( i != str.end() && *i != '>')
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    out << str[i++];
 | 
					                    out << *i++;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                out << '>';
 | 
					                out << '>';
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
@@ -49,7 +48,7 @@ static wxString LINKAGEMODE HtmlizeLinebreaks(const wxString& str)
 | 
				
			|||||||
                out << "<br>";
 | 
					                out << "<br>";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            default:
 | 
					            default:
 | 
				
			||||||
                out << str[i];
 | 
					                out << *i;
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user