Another blind fix for wxTextDataObject under macOS

Use the length provided to SetData() instead of assuming it is NUL-terminated
in the wxNEEDS_UTF16_FOR_TEXT_DATAOBJ case too, and not only in the
wxNEEDS_UTF8_FOR_TEXT_DATAOBJ onem, as was done by the previous attempt to fix
this in 20c130a578.

Closes #9522.
This commit is contained in:
Vadim Zeitlin
2016-11-26 18:44:00 +01:00
parent cb2474f040
commit 110d1b03e5

View File

@@ -394,13 +394,13 @@ bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const
}
bool wxTextDataObject::SetData(const wxDataFormat& format,
size_t WXUNUSED(len),
size_t len,
const void *buf)
{
if ( buf == NULL )
return false;
SetText(GetConv(format).cMB2WX(static_cast<const char*>(buf)));
SetText(GetConv(format).cMB2WC(static_cast<const char*>(buf), len, NULL));
return true;
}