chop off the unwanted \r from GetLineText() return value for richedit 2.0 controls (patch 1780110)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48627 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-09-10 11:16:04 +00:00
parent 075946015d
commit e1ef6b5da5

View File

@@ -1712,9 +1712,16 @@ wxString wxTextCtrl::GetLineText(long lineNo) const
// should never see it
if ( buf[len - 2] == _T('\r') && buf[len - 1] == _T('\n') )
{
// richedit 1.0 uses "\r\n" as line terminator, so remove "\r"
// here and "\n" below
buf[len - 2] = _T('\n');
len--;
}
else if ( buf[len - 1] == _T('\r') )
{
// richedit 2.0+ uses only "\r", replace it with "\n"
buf[len - 1] = _T('\n');
}
}
#endif // wxUSE_RICHEDIT