]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/m_pre.cpp
no changes, just a typo
[wxWidgets.git] / src / html / m_pre.cpp
index b2a5cb89e555bf48a42f0dbd536554bdb6e071d2..c4a33f8c82892f84fcde411bc1d5995ca31a537d 100644 (file)
@@ -33,26 +33,29 @@ static wxString LINKAGEMODE HtmlizeLinebreaks(const wxString& str)
     wxString out;
     out.reserve(str.length()); // we'll certainly need at least that
 
-    size_t len = str.Len();
-    for (size_t i = 0; i < len; i++)
+    const wxString::const_iterator end = str.end();
+    for ( wxString::const_iterator i = str.begin(); i != end; ++i )
     {
-        switch ( str[i].GetValue() )
+        switch ( (*i).GetValue() )
         {
             case '<':
-                while (i < len && str[i] != '>')
+                while ( i != end && *i != '>' )
                 {
-                    out << str[i++];
+                    out << *i++;
                 }
                 out << '>';
+                if ( i == end )
+                    return out;
                 break;
             case '\n':
                 out << "<br>";
                 break;
             default:
-                out << str[i];
+                out << *i;
                 break;
         }
     }
+
     return out;
 }