Blind fix for wxTextDataObject trailing NUL under OS X.

Use the length provided to SetData() instead of assuming it is NUL-terminated.

Closes #9522.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78318 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-12-25 01:32:10 +00:00
parent 25412dd286
commit 20c130a578

View File

@ -284,12 +284,12 @@ bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const
} }
bool wxTextDataObject::SetData(const wxDataFormat& format, bool wxTextDataObject::SetData(const wxDataFormat& format,
size_t WXUNUSED(len), const void *buf) size_t len, const void *buf)
{ {
if ( buf == NULL ) if ( buf == NULL )
return false; return false;
wxWCharBuffer buffer = GetConv(format).cMB2WX( (const char*)buf ); wxWCharBuffer buffer = GetConv(format).cMB2WC((const char*)buf, len, NULL);
SetText( buffer ); SetText( buffer );