Blind fix for wxTextDataObject trailing NUL under OS X.

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

Closes #9522.

(this is a backport of 20c130a578 from master)
This commit is contained in:
Vadim Zeitlin
2014-12-25 01:32:10 +00:00
parent 312ae4c92c
commit 21dc1a1d4f
2 changed files with 3 additions and 2 deletions

View File

@@ -633,6 +633,7 @@ wxOSX:
- Compilation fix for wxWebView under 10.10.
- Fix conversion of wxBitmap to wxImage in 64 bit builds.
- Fix length of text in wxTextDataObject.
- Fix using wxHTTP and wxFTP from worker thread.
- Fix wxFileDialog::GetFilterIndex() for file open dialogs (phsilva).
- Fix custom paper support (tijsv).

View File

@@ -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 );