git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71804
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#include "wx/mstream.h"
#include "wx/metafile.h"
#include "wx/tokenzr.h"
#include "wx/mstream.h"
#include "wx/metafile.h"
#include "wx/tokenzr.h"
+#include "wx/filename.h"
#include "wx/osx/private.h"
#include "wx/osx/private.h"
#include <QuickTime/QuickTime.h>
#endif
#include <QuickTime/QuickTime.h>
#endif
// ----------------------------------------------------------------------------
// wxDataFormat
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// wxDataFormat
// ----------------------------------------------------------------------------
{
m_type = wxDF_METAFILE;
}
{
m_type = wxDF_METAFILE;
}
- else if ( UTTypeConformsTo( (CFStringRef)format, CFSTR("public.file-url") ) )
+ else if ( UTTypeConformsTo( (CFStringRef)format, CFSTR("public.file-url") ) ||
+ UTTypeConformsTo( (CFStringRef)format, kPasteboardTypeFileURLPromise))
{
m_type = wxDF_FILENAME;
}
{
m_type = wxDF_FILENAME;
}
if ( dataFormat == flavorFormat )
{
if ( dataFormat == flavorFormat )
{
+ if ( UTTypeConformsTo( (CFStringRef)flavorType, kPasteboardTypeFileURLPromise) )
+ {
+ wxString tempdir = wxFileName::GetTempDir() + wxFILE_SEP_PATH + "wxtemp.XXXXXX";
+ char* result = mkdtemp((char*)tempdir.fn_str().data());
+
+ if (!result)
+ continue;
+
+ wxCFRef<CFURLRef> dest(CFURLCreateFromFileSystemRepresentation(NULL,(const UInt8*)result,strlen(result),true));
+ PasteboardSetPasteLocation(pasteboard, dest);
+ }
err = PasteboardCopyItemFlavorData( pasteboard, itemID, flavorType , &flavorData );
if ( err == noErr )
{
flavorDataSize = CFDataGetLength( flavorData );
if (dataFormat.GetType() == wxDF_FILENAME )
{
err = PasteboardCopyItemFlavorData( pasteboard, itemID, flavorType , &flavorData );
if ( err == noErr )
{
flavorDataSize = CFDataGetLength( flavorData );
if (dataFormat.GetType() == wxDF_FILENAME )
{
- // revert the translation and decomposition to arrive at a proper utf8 string again
+ // revert the translation and decomposition to arrive at a proper utf8 string again
CFURLRef url = CFURLCreateWithBytes( kCFAllocatorDefault, CFDataGetBytePtr( flavorData ), flavorDataSize, kCFStringEncodingUTF8, NULL );
CFStringRef cfString = CFURLCopyFileSystemPath( url, kCFURLPOSIXPathStyle );
CFRelease( url );
CFURLRef url = CFURLCreateWithBytes( kCFAllocatorDefault, CFDataGetBytePtr( flavorData ), flavorDataSize, kCFStringEncodingUTF8, NULL );
CFStringRef cfString = CFURLCopyFileSystemPath( url, kCFURLPOSIXPathStyle );
CFRelease( url );