]> git.saurik.com Git - wxWidgets.git/commitdiff
don't return \n from GetLineText() neither
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 31 Aug 2003 21:09:27 +0000 (21:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 31 Aug 2003 21:09:27 +0000 (21:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/textctrl.cpp

index fda9d0207d5935e029991083d892078f26c1e0f8..a00d54dcd6d8baa56eaecb4af3e185a8f9bf35e4 100644 (file)
@@ -1291,6 +1291,13 @@ wxString wxTextCtrl::GetLineText(long lineNo) const
         }
 #endif // wxUSE_RICHEDIT
 
+        // remove the '\n' at the end, if any (this is how this function is
+        // supposed to work according to the docs)
+        if ( buf[len - 1] == _T('\n') )
+        {
+            len--;
+        }
+
         buf[len] = 0;
         tmp.SetLength(len);
     }