make sure the pasteboard paste location is only set once
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71913 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -401,6 +401,7 @@ bool wxDataObject::GetFromPasteboard( void * pb )
|
||||
ItemCount itemCount = 0;
|
||||
wxString filenamesPassed;
|
||||
bool transferred = false;
|
||||
bool pastelocationset = false;
|
||||
|
||||
// we synchronize here once again, so we don't mind which flags get returned
|
||||
PasteboardSynchronize( pasteboard );
|
||||
@@ -443,6 +444,8 @@ bool wxDataObject::GetFromPasteboard( void * pb )
|
||||
if ( dataFormat == flavorFormat )
|
||||
{
|
||||
if ( UTTypeConformsTo( (CFStringRef)flavorType, kPasteboardTypeFileURLPromise) )
|
||||
{
|
||||
if ( !pastelocationset )
|
||||
{
|
||||
wxString tempdir = wxFileName::GetTempDir() + wxFILE_SEP_PATH + "wxtemp.XXXXXX";
|
||||
char* result = mkdtemp((char*)tempdir.fn_str().data());
|
||||
@@ -452,6 +455,8 @@ bool wxDataObject::GetFromPasteboard( void * pb )
|
||||
|
||||
wxCFRef<CFURLRef> dest(CFURLCreateFromFileSystemRepresentation(NULL,(const UInt8*)result,strlen(result),true));
|
||||
PasteboardSetPasteLocation(pasteboard, dest);
|
||||
pastelocationset = true;
|
||||
}
|
||||
}
|
||||
else if ( flavorFormat.GetType() != wxDF_PRIVATE )
|
||||
{
|
||||
|
Reference in New Issue
Block a user