#if wxUSE_DATAOBJ
#include "wx/dataobj.h"
-
-// No: don't necessarily use OLE clipboard with data object
-#if 0
- // use OLE clipboard
- #define wxUSE_OLE_CLIPBOARD 1
#endif
+
+#if wxUSE_OLE
+ // use OLE clipboard
+ #define wxUSE_OLE_CLIPBOARD 1
#else // !wxUSE_DATAOBJ
// use Win clipboard API
#define wxUSE_OLE_CLIPBOARD 0
#elif wxUSE_DATAOBJ
wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") );
- wxDataFormat format = data->GetFormat();
+ wxDataFormat format = data->GetPreferredFormat();
switch ( format )
{
{
wxBitmapDataObject* bitmapDataObject = (wxBitmapDataObject*) data;
wxBitmap bitmap(bitmapDataObject->GetBitmap());
- return wxSetClipboardData(data->GetFormat(), &bitmap);
+ return wxSetClipboardData(data->GetPreferredFormat(), &bitmap);
}
#if wxUSE_METAFILE
case wxDF_METAFILE:
{
+#if 1
+ // TODO
+ wxLogError("Not implemented because wxMetafileDataObject does not contain width and height values.");
+ return FALSE;
+#else
wxMetafileDataObject* metaFileDataObject =
(wxMetafileDataObject*) data;
wxMetafile metaFile = metaFileDataObject->GetMetafile();
return wxSetClipboardData(wxDF_METAFILE, &metaFile,
metaFileDataObject->GetWidth(),
metaFileDataObject->GetHeight());
+#endif
}
#endif // wxUSE_METAFILE
default:
- return wxSetClipboardData(data);
+ {
+// This didn't compile, of course
+// return wxSetClipboardData(data);
+ // TODO
+ wxLogError("Not implemented.");
+ return FALSE;
+ }
}
#else // !wxUSE_DATAOBJ
return FALSE;
// build the list of supported formats
size_t nFormats = data.GetFormatCount(wxDataObject::Set);
wxDataFormat format;
- wxDataFormat *formats;
+ wxDataFormat *formats;
if ( nFormats == 1 )
{
// the most common case
#elif wxUSE_DATAOBJ
wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") );
- wxDataFormat format = data.GetFormat();
+ wxDataFormat format = data.GetPreferredFormat();
switch ( format )
{
case wxDF_TEXT:
case wxDF_DIB:
{
wxBitmapDataObject& bitmapDataObject = (wxBitmapDataObject &)data;
- wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data->GetFormat());
+ wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data.GetPreferredFormat());
if ( !bitmap )
return FALSE;
#endif // wxUSE_OLE_CLIPBOARD/wxUSE_DATAOBJ
}
-#else
-// #error "Please turn wxUSE_CLIPBOARD on to compile this file."
#endif // wxUSE_CLIPBOARD