diff --git a/docs/changes.txt b/docs/changes.txt index 73b5f43c11..6c0fca69bc 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -501,6 +501,7 @@ GTK: - wxRadioBox constructor uses default consistent with other ports now. - Partially implemented wxTextCtrl::GetStyle() (Igor Romanov). - Corrected themed border display. +- Fix wxClipboard::GetData() for asymmetric wxDataObjects (Timothy Lee). Mac: diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index 8276951829..56fa9e1eb8 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -674,10 +674,11 @@ bool wxClipboard::GetData( wxDataObject& data ) { wxCHECK_MSG( m_open, false, wxT("clipboard not open") ); - // get all supported formats from wxDataObjects - const size_t count = data.GetFormatCount(); + // get all supported formats from wxDataObjects: notice that we are setting + // the object data, so we need them in "Set" direction + const size_t count = data.GetFormatCount(wxDataObject::Set); wxDataFormatArray formats(new wxDataFormat[count]); - data.GetAllFormats(formats.get()); + data.GetAllFormats(formats.get(), wxDataObject::Set); for ( size_t i = 0; i < count; i++ ) {