From 7eb670ac1496863b7b2717284037d485597ce75b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 12 Mar 2010 09:27:10 +0000 Subject: [PATCH] Correct query for formats supported by wxDataObject in wxGTK wxClipboard. We wrongly asked wxDataObject for the formats it could provide on output instead of those it accepted as input in wxClipboard::GetData() in wxGTK. This could result in clipboard not working for "asymmetrical" data objects. See #11811. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63661 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/gtk/clipbrd.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) 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++ ) { -- 2.45.2