]> git.saurik.com Git - wxWidgets.git/commitdiff
correct indices used in StringToLines() (modified patch 1882985)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Feb 2008 21:06:17 +0000 (21:06 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Feb 2008 21:06:17 +0000 (21:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index 91cf67383e3ba2d8338858c0c6ee9754dd6a0c41..ecadf47f4283623f034e7eb88977aff1889f966b 100644 (file)
@@ -8106,6 +8106,7 @@ void wxGrid::DrawTextRectangle(wxDC& dc,
 // Split multi-line text up into an array of strings.
 // Any existing contents of the string array are preserved.
 //
+// TODO: refactor wxTextFile::Read() and reuse the same code from here
 void wxGrid::StringToLines( const wxString& value, wxArrayString& lines ) const
 {
     int startPos = 0;
@@ -8126,7 +8127,7 @@ void wxGrid::StringToLines( const wxString& value, wxArrayString& lines ) const
         }
         else
         {
-            lines.Add( value.Mid(startPos, pos) );
+            lines.Add( tVal.Mid(startPos, pos) );
         }
 
         startPos += pos + 1;
@@ -8134,7 +8135,7 @@ void wxGrid::StringToLines( const wxString& value, wxArrayString& lines ) const
 
     if ( startPos < (int)value.length() )
     {
-        lines.Add( value.Mid( startPos ) );
+        lines.Add( tVal.Mid( startPos ) );
     }
 }