// Author: Stefan Csomor
// Modified by:
// Created: 10/21/99
-// RCS-ID: $Id$
// Copyright: (c) 1999 Stefan Csomor
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
return found;
}
-void wxDataObject::AddToPasteboard( void * pb, int itemID )
+void wxDataObject::AddToPasteboard( void * pb, wxIntPtr itemID )
{
PasteboardRef pasteboard = (PasteboardRef) pb;
// get formats from wxDataObjects
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
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;
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;
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 ];
{
CFArrayAppendValue((CFMutableArrayRef)cfarray, kUTTypePDF);
}
+ else if ( dataFormat.GetType() == wxDF_PRIVATE )
+ {
+ CFArrayAppendValue((CFMutableArrayRef)cfarray, (CFStringRef) dataFormat.GetFormatId());
+ }
}
delete[] array;
}
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