+ Size dataSize ;
+ Ptr theData ;
+ GetFlavorDataSize((DragReference)m_currentDrag, theItem, theType, &dataSize);
+ if ( theType == 'TEXT' )
+ {
+ // this increment is only valid for allocating, on the next GetFlavorData
+ // call it is reset again to the original value
+ dataSize++ ;
+ }
+ theData = new char[dataSize];
+ GetFlavorData((DragReference)m_currentDrag, theItem, theType, (void*) theData, &dataSize, 0L);
+ if( theType == 'TEXT' )
+ {
+ theData[dataSize]=0 ;
+ wxString convert = wxMacMakeStringFromCString( theData ) ;
+ m_dataObject->SetData( format, convert.Length() * sizeof(wxChar), (const wxChar*) convert );
+ }
+ else if ( theType == kDragFlavorTypeHFS )
+ {
+ HFSFlavor* theFile = (HFSFlavor*) theData ;
+ wxString name = wxMacFSSpec2MacFilename( &theFile->fileSpec ) ;
+ if ( firstFileAdded )
+ ((wxFileDataObject*)m_dataObject)->AddFile( name ) ;
+ else
+ {
+ ((wxFileDataObject*)m_dataObject)->SetData( 0 , name.c_str() ) ;
+ firstFileAdded = true ;
+ }
+ }
+ else
+ {
+ m_dataObject->SetData( format, dataSize, theData );
+ }
+ delete[] theData;