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:
parent
25412dd286
commit
20c130a578
@ -284,12 +284,12 @@ bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const
|
||||
}
|
||||
|
||||
bool wxTextDataObject::SetData(const wxDataFormat& format,
|
||||
size_t WXUNUSED(len), const void *buf)
|
||||
size_t len, const void *buf)
|
||||
{
|
||||
if ( buf == NULL )
|
||||
return false;
|
||||
|
||||
wxWCharBuffer buffer = GetConv(format).cMB2WX( (const char*)buf );
|
||||
wxWCharBuffer buffer = GetConv(format).cMB2WC((const char*)buf, len, NULL);
|
||||
|
||||
SetText( buffer );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user