X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f31c06b39e4eaff67776ab2e823a83f924d7a145..3287f62ad3bd6dfcc78a8fcef0ac44d9ece904af:/src/osx/carbon/dataobj.cpp diff --git a/src/osx/carbon/dataobj.cpp b/src/osx/carbon/dataobj.cpp index db8e5dd548..2b625d0e06 100644 --- a/src/osx/carbon/dataobj.cpp +++ b/src/osx/carbon/dataobj.cpp @@ -4,7 +4,6 @@ // Author: Stefan Csomor // Modified by: // Created: 10/21/99 -// RCS-ID: $Id$ // Copyright: (c) 1999 Stefan Csomor // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -260,7 +259,7 @@ bool wxDataObject::IsSupportedFormat( const wxDataFormat& rFormat, Direction vDi return found; } -void wxDataObject::AddToPasteboard( void * pb, int itemID ) +void wxDataObject::AddToPasteboard( void * pb, wxIntPtr itemID ) { PasteboardRef pasteboard = (PasteboardRef) pb; // get formats from wxDataObjects @@ -302,7 +301,7 @@ void wxDataObject::AddToPasteboard( void * pb, int itemID ) memset( buf, 0, sz ); if ( GetDataHere( thisFormat, buf ) ) { - int counter = 1 ; + wxIntPtr counter = 1 ; if ( thisFormat.GetType() == wxDF_FILENAME ) { // the data is D-normalized UTF8 strings of filenames delimited with \n @@ -394,10 +393,11 @@ bool wxDataObject::IsFormatInPasteboard( void * pb, const wxDataFormat &dataForm bool wxDataObject::GetFromPasteboard( void * pb ) { PasteboardRef pasteboard = (PasteboardRef) pb; - size_t formatcount = GetFormatCount() + 1; + + size_t formatcount = GetFormatCount(wxDataObject::Set); wxDataFormat *array = new wxDataFormat[ formatcount ]; - array[0] = GetPreferredFormat(); - GetAllFormats( &array[1] ); + GetAllFormats(array, wxDataObject::Set); + ItemCount itemCount = 0; wxString filenamesPassed; bool transferred = false; @@ -538,10 +538,9 @@ bool wxDataObject::GetFromPasteboard( void * pb ) bool wxDataObject::HasDataInPasteboard( void * pb ) { PasteboardRef pasteboard = (PasteboardRef) pb; - size_t formatcount = GetFormatCount() + 1; + size_t formatcount = GetFormatCount(wxDataObject::Set); wxDataFormat *array = new wxDataFormat[ formatcount ]; - array[0] = GetPreferredFormat(); - GetAllFormats( &array[1] ); + GetAllFormats(array, wxDataObject::Set); ItemCount itemCount = 0; bool hasData = false; @@ -598,10 +597,11 @@ bool wxDataObject::HasDataInPasteboard( void * pb ) void wxDataObject::AddSupportedTypes( void* cfarray) { - wxDataFormat *array = new wxDataFormat[ GetFormatCount() ]; - GetAllFormats( array ); + size_t nFormats = GetFormatCount(wxDataObject::Set); + wxDataFormat *array = new wxDataFormat[nFormats]; + GetAllFormats(array, wxDataObject::Set); - for (size_t i = 0; i < GetFormatCount(); i++) + for (size_t i = 0; i < nFormats; i++) { wxDataFormat dataFormat = array[ i ]; @@ -628,6 +628,10 @@ void wxDataObject::AddSupportedTypes( void* cfarray) { CFArrayAppendValue((CFMutableArrayRef)cfarray, kUTTypePDF); } + else if ( dataFormat.GetType() == wxDF_PRIVATE ) + { + CFArrayAppendValue((CFMutableArrayRef)cfarray, (CFStringRef) dataFormat.GetFormatId()); + } } delete[] array; } @@ -642,8 +646,8 @@ void wxDataObject::AddSupportedTypes( void* cfarray) void wxTextDataObject::GetAllFormats(wxDataFormat *formats, wxDataObjectBase::Direction WXUNUSED(dir)) const { - *formats++ = wxDataFormat( wxDF_TEXT ); - *formats = wxDataFormat( wxDF_UNICODETEXT ); + *formats++ = wxDataFormat(wxDF_UNICODETEXT); + *formats = wxDataFormat(wxDF_TEXT); } #endif