]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct query for formats supported by wxDataObject in wxGTK wxClipboard.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 12 Mar 2010 09:27:10 +0000 (09:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 12 Mar 2010 09:27:10 +0000 (09:27 +0000)
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
src/gtk/clipbrd.cpp

index 73b5f43c116ab98578aad06434880935b9204489..6c0fca69bc489eb4d3b384eae32c8f7a852a5c93 100644 (file)
@@ -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:
 
index 827695182938d42b86b677b04cbf89ec689917ac..56fa9e1eb890afa1d0378d561fc0da4b5c10c8ad 100644 (file)
@@ -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++ )
     {