]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dcbase.cpp
added wxString::FromAscii(char*,size_t) for consistency with FromUTF8()
[wxWidgets.git] / src / common / dcbase.cpp
index 249af182a671d52126707f2a0e6debb6a4d97d5f..f42c88530e070a08b9cc46f1e58e263eb8759efc 100644 (file)
@@ -2172,9 +2172,9 @@ void wxDCBase::GetMultiLineTextExtent(const wxString& text,
             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() )
             {
@@ -2205,14 +2205,13 @@ void wxDCBase::GetMultiLineTextExtent(const wxString& text,
                 heightTextTotal += heightLine;
             }
 
-            if ( *pc == _T('\n') )
+            if ( pc == text.end() )
             {
-               curLine.clear();
+               break;
             }
-            else
+            else // '\n'
             {
-               // the end of string
-               break;
+               curLine.clear();
             }
         }
         else