X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9d46359178b28cd86e189e877015a8e69ff5bbaa..8064223b7b1b3657363b7a635c381b9269d95e55:/src/mac/carbon/dnd.cpp diff --git a/src/mac/carbon/dnd.cpp b/src/mac/carbon/dnd.cpp index 67e9bbf452..961eb6da0f 100644 --- a/src/mac/carbon/dnd.cpp +++ b/src/mac/carbon/dnd.cpp @@ -212,11 +212,13 @@ wxDropSource::~wxDropSource() { } -OSStatus wxMacPromiseKeeper( PasteboardRef inPasteboard, PasteboardItemID inItem, CFStringRef inFlavorType, - void *inContext ) +OSStatus wxMacPromiseKeeper(PasteboardRef WXUNUSED(inPasteboard), + PasteboardItemID WXUNUSED(inItem), + CFStringRef WXUNUSED(inFlavorType), + void * WXUNUSED(inContext)) { OSStatus err = noErr; - + // we might add promises here later, inContext is the wxDropSource* return err; @@ -233,37 +235,37 @@ wxDragResult wxDropSource::DoDragDrop(int flags) RgnHandle dragRegion; OSStatus err = noErr; PasteboardRef pasteboard; - + // add data to drag - + err = PasteboardCreate( kPasteboardUniqueName, &pasteboard ); if ( err != noErr ) return wxDragNone; - + // we add a dummy promise keeper because of strange messages when linking against carbon debug - err = PasteboardSetPromiseKeeper( pasteboard, wxMacPromiseKeeper, this ); + err = PasteboardSetPromiseKeeper( pasteboard, wxMacPromiseKeeper, this ); if ( err != noErr ) { CFRelease( pasteboard ); return wxDragNone; } - - err = PasteboardClear( pasteboard ); + + err = PasteboardClear( pasteboard ); if ( err != noErr ) { CFRelease( pasteboard ); return wxDragNone; } - PasteboardSynchronize( pasteboard ); - + PasteboardSynchronize( pasteboard ); + m_data->AddToPasteboard( pasteboard, 1 ); - + if (NewDragWithPasteboard( pasteboard , &theDrag) != noErr) { CFRelease( pasteboard ); return wxDragNone; } - + dragRegion = NewRgn(); RgnHandle tempRgn = NewRgn(); @@ -298,7 +300,7 @@ wxDragResult wxDropSource::DoDragDrop(int flags) gTrackingGlobals.m_flags = flags; err = TrackDrag( theDrag, &rec, dragRegion ); - + DisposeRgn( dragRegion ); DisposeDrag( theDrag ); CFRelease( pasteboard );