X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f38924e863cd44e2abd49d20d201d72aa773c51e..65fd2fc2616552e4204223b7c2b69d9bc87c1f2d:/src/mac/carbon/dataobj.cpp diff --git a/src/mac/carbon/dataobj.cpp b/src/mac/carbon/dataobj.cpp index 041084127d..748c387ad6 100644 --- a/src/mac/carbon/dataobj.cpp +++ b/src/mac/carbon/dataobj.cpp @@ -20,10 +20,10 @@ #include "wx/intl.h" #include "wx/log.h" #include "wx/dcmemory.h" + #include "wx/image.h" #endif #include "wx/mstream.h" -#include "wx/image.h" #include "wx/metafile.h" #include "wx/tokenzr.h" @@ -49,11 +49,6 @@ wxDataFormat::wxDataFormat( wxDataFormatId vType ) SetType( vType ); } -wxDataFormat::wxDataFormat( const wxChar *zId ) -{ - SetId( zId ); -} - wxDataFormat::wxDataFormat( const wxString& rId ) { SetId( rId ); @@ -137,7 +132,7 @@ void wxDataFormat::SetId( NativeFormat format ) } } -void wxDataFormat::SetId( const wxChar* zId ) +void wxDataFormat::SetId( const wxString& zId ) { m_type = wxDF_PRIVATE; m_id = zId; @@ -251,7 +246,7 @@ bool wxFileDataObject::SetData( size_t nSize, const void *pBuf ) #if wxUSE_UNICODE filenames = wxString( (const char*)pBuf, *wxConvFileName ); #else - filenames = wxString( wxConvFileName->cMB2WX( (const char*)pBuf ), wxConvLocal ); + filenames = wxString (wxConvLocal.cWC2WX(wxConvFileName->cMB2WC( (const char*)pBuf))); #endif m_filenames = wxStringTokenize( filenames, wxT("\n"), wxTOKEN_STRTOK ); @@ -311,8 +306,10 @@ void wxBitmapDataObject::Clear() { if (m_pictHandle != NULL) { +#ifndef __LP64__ if (m_pictCreated) KillPicture( (PicHandle)m_pictHandle ); +#endif m_pictHandle = NULL; } @@ -356,16 +353,21 @@ bool wxBitmapDataObject::SetData( size_t nSize, const void *pBuf ) // ownership is transferred to the bitmap m_pictCreated = false; +#ifndef __LP64__ Rect frame; wxMacGetPictureBounds( picHandle, &frame ); - +#if wxUSE_METAFILE wxMetafile mf; mf.SetHMETAFILE( (WXHMETAFILE)m_pictHandle ); +#endif wxMemoryDC mdc; m_bitmap.Create( frame.right - frame.left, frame.bottom - frame.top ); mdc.SelectObject( m_bitmap ); +#if wxUSE_METAFILE mf.Play( &mdc ); +#endif mdc.SelectObject( wxNullBitmap ); +#endif return m_bitmap.Ok(); }