+ if ( m_data )
+ {
+ for (size_t i = 0; !transferred && i < formatcount ; i++)
+ {
+ wxDataFormat format = array[i] ;
+ if ( m_data->IsSupported( format ) )
+ {
+ int size = m_data->GetDataSize( format );
+ transferred = true ;
+
+ if (size == 0)
+ {
+ data.SetData(format , 0 , 0 ) ;
+ }
+ else
+ {
+ char *d = new char[size];
+ m_data->GetDataHere( format , (void*) d );
+ data.SetData( format , size , d ) ;
+ delete[] d ;
+ }
+ }
+ }
+ }
+ /* get formats from wxDataObjects */
+ if ( !transferred )
+ {
+ for (size_t i = 0; !transferred && i < formatcount ; i++)
+ {
+ wxDataFormat format = array[i] ;
+
+ switch ( format.GetType() )
+ {
+ case wxDF_TEXT :
+ case wxDF_OEMTEXT :
+ case wxDF_BITMAP :
+ case wxDF_METAFILE :
+ {
+ long len ;
+ char* s = (char*)wxGetClipboardData(format, &len );
+ if ( s )
+ {
+ data.SetData( format , len , s ) ;
+ delete [] s;
+
+ transferred = true ;
+ }
+ }
+ break ;
+
+ default :
+ break ;
+ }
+ }
+ }