#include "wx/osx/private.h"
-#ifdef __DARWIN__
+#if wxOSX_USE_COCOA_OR_CARBON
#include <QuickTime/QuickTime.h>
#endif
{
m_type = wxDF_UNICODETEXT;
}
+ else if ( UTTypeConformsTo( (CFStringRef)format, CFSTR("public.utf16-external-plain-text") ) )
+ {
+ m_type = wxDF_UNICODETEXT;
+ }
else if ( UTTypeConformsTo( (CFStringRef)format, CFSTR("public.plain-text") ) )
{
m_type = wxDF_TEXT;
}
CFRelease( flavorTypeArray );
}
- if (filenamesPassed.length() > 0)
+ if ( !filenamesPassed.empty() )
{
wxCharBuffer buf = filenamesPassed.fn_str();
SetData( wxDF_FILENAME, strlen( buf ), (const char*)buf );
wxDataFormat flavorFormat( (wxDataFormat::NativeFormat) flavorType );
if ( dataFormat == flavorFormat ||
- dataFormat.GetType() == wxDF_UNICODETEXT && flavorFormat.GetType() == wxDF_TEXT )
+ (dataFormat.GetType() == wxDF_UNICODETEXT && flavorFormat.GetType() == wxDF_TEXT) )
{
hasData = true;
}
{
Init();
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
SetBitmap( rBitmap );
}
{
Clear();
wxBitmapDataObjectBase::SetBitmap( rBitmap );
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
CGImageRef cgImageRef = (CGImageRef) m_bitmap.CreateCGImage();
if ( source )
{
cgImageRef = CGImageSourceCreateImageAtIndex(source, 0, NULL);
+ CFRelease( source );
}
- CFRelease( source );
CFRelease( data );
if ( cgImageRef )
cgImageRef = NULL;
}
- return m_bitmap.Ok();
+ return m_bitmap.IsOk();
}
#endif