]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dcbase.cpp
Applied patch [ 1701723 ] wxAUI: Added event for doubleclicks on the tabbar bg
[wxWidgets.git] / src / common / dcbase.cpp
index 249af182a671d52126707f2a0e6debb6a4d97d5f..67f907abca5cf755efba9db91d30fa17ca1a5c47 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
@@ -2303,7 +2302,7 @@ void wxDCBase::DrawLabel(const wxString& text,
     wxString curLine;
     for ( wxString::const_iterator pc = text.begin(); ; ++pc )
     {
-        if ( *pc == _T('\n') || pc == text.end() )
+        if ( pc == text.end() || *pc == _T('\n') )
         {
             int xRealStart = x; // init it here to avoid compielr warnings