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:
@@ -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).
|
||||
|
@@ -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 );
|
||||
|
||||
|
Reference in New Issue
Block a user