- for (size_t i = 0; i < m_data->GetFormatCount(); i++)
- {
- if (array[i].IsStandard())
- {
- wxLogTrace( TRACE_CLIPBOARD,
- wxT("wxClipboard now supports standard atom type %d"),
- array[i].GetType() );
- }
- else
- {
- wxLogTrace( TRACE_CLIPBOARD,
- wxT("wxClipboard now supports atom %s"),
- array[i].GetId().c_str() );
- }
-
- size_t sz = data->GetDataSize( array[ i ] );
- void* buf = malloc( sz + 1 );
- if ( buf != NULL )
- {
- // empty the buffer because in some case GetDataHere does not fill buf
- memset( buf, 0, sz + 1 );
- data->GetDataHere( array[ i ], buf );
- OSType mactype = 0;
- switch ( array[i].GetType() )
- {
- case wxDF_TEXT:
- case wxDF_OEMTEXT:
- mactype = kScrapFlavorTypeText;
- sz -= 1;
- break;
-
-#if wxUSE_UNICODE
- case wxDF_UNICODETEXT:
- mactype = kScrapFlavorTypeUnicode;
- sz -= 2;
- break;
-#endif
-
-#if wxUSE_DRAG_AND_DROP
- case wxDF_METAFILE:
- mactype = kScrapFlavorTypePicture;
- break;
-#endif
-
- case wxDF_BITMAP:
- case wxDF_DIB:
- mactype = kScrapFlavorTypePicture;
- break;
-
- default:
- mactype = (OSType)(array[ i ].GetFormatId());
- break;
- }
-
- UMAPutScrap( sz , mactype , buf );
- free( buf );
- }
- }
-
- delete [] array;