reverted the change of r56246 and keep the old behaviour of MB2WC/WC2MB; document it even more clearly and correct code using these functions incorrectly

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@56394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-10-17 11:31:22 +00:00
parent 2471348611
commit 753874333a
5 changed files with 36 additions and 34 deletions

View File

@@ -947,14 +947,14 @@ wxTextCtrl::StreamIn(const wxString& value,
return false;
#if wxUSE_WCHAR_T
wxWCharBuffer wchBuf(len);
wxWCharBuffer wchBuf(len); // allocates one extra character
wchar_t *wpc = wchBuf.data();
#else
wchar_t *wchBuf = (wchar_t *)malloc((len + 1)*sizeof(wchar_t));
wchar_t *wpc = wchBuf;
#endif
conv.MB2WC(wpc, value, value.length());
conv.MB2WC(wpc, value, len + 1);
#endif // wxUSE_UNICODE_MSLU
// finally, stream it in the control