Author: hdu Date: Wed Jun 24 07:08:31 2015 New Revision: 1687177 URL: http://svn.apache.org/r1687177 Log: #i105098# fix drag&drop insertion of files/images on Mac
Fixed-by: Manik <[email protected]> Reviewed-by: Herbert Duerr <[email protected]> Modified: openoffice/trunk/main/vcl/aqua/source/dtrans/DropTarget.cxx openoffice/trunk/main/vcl/aqua/source/dtrans/DropTarget.hxx Modified: openoffice/trunk/main/vcl/aqua/source/dtrans/DropTarget.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/dtrans/DropTarget.cxx?rev=1687177&r1=1687176&r2=1687177&view=diff ============================================================================== --- openoffice/trunk/main/vcl/aqua/source/dtrans/DropTarget.cxx (original) +++ openoffice/trunk/main/vcl/aqua/source/dtrans/DropTarget.cxx Wed Jun 24 07:08:31 2015 @@ -133,7 +133,8 @@ namespace /* private */ -(BOOL)performDragOperation:(id <NSDraggingInfo>)sender { - return mDropTarget->performDragOperation(sender); + (void) sender; + return mDropTarget->performDragOperation(); } @@ -235,10 +236,13 @@ NSDragOperation DropTarget::draggingEnte sal_Int8 currentAction = determineDropAction(mDragSourceSupportedActions, sender); NSRect bounds = [mView bounds]; - NSPoint dragLocation = [sender draggedImageLocation]; - + NSPoint mouseLoc = [NSEvent mouseLocation]; + + id wnd = [mView window]; + NSPoint dragLocation = [mView convertPoint:[wnd convertScreenToBase:mouseLoc] fromView:nil]; + CocoaToVCL(dragLocation, bounds); - + sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x); sal_Int32 posY = static_cast<sal_Int32>(dragLocation.y); @@ -274,7 +278,10 @@ NSDragOperation DropTarget::draggingUpda { sal_Int8 currentAction = determineDropAction(currentDragSourceActions, sender); NSRect bounds = [mView bounds]; - NSPoint dragLocation = [sender draggedImageLocation]; + NSPoint mouseLoc = [NSEvent mouseLocation]; + + id wnd = [mView window]; + NSPoint dragLocation = [mView convertPoint:[wnd convertScreenToBase:mouseLoc] fromView:nil]; CocoaToVCL(dragLocation, bounds); @@ -326,7 +333,7 @@ BOOL DropTarget::prepareForDragOperation } -BOOL DropTarget::performDragOperation(id sender) +BOOL DropTarget::performDragOperation() { bool bSuccess = false; @@ -340,7 +347,10 @@ BOOL DropTarget::performDragOperation(id } NSRect bounds = [mView bounds]; - NSPoint dragLocation = [sender draggedImageLocation]; + NSPoint mouseLoc = [NSEvent mouseLocation]; + + id wnd = [mView window]; + NSPoint dragLocation = [mView convertPoint:[wnd convertScreenToBase:mouseLoc] fromView:nil]; CocoaToVCL(dragLocation, bounds); Modified: openoffice/trunk/main/vcl/aqua/source/dtrans/DropTarget.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/dtrans/DropTarget.hxx?rev=1687177&r1=1687176&r2=1687177&view=diff ============================================================================== --- openoffice/trunk/main/vcl/aqua/source/dtrans/DropTarget.hxx (original) +++ openoffice/trunk/main/vcl/aqua/source/dtrans/DropTarget.hxx Wed Jun 24 07:08:31 2015 @@ -133,7 +133,7 @@ public: virtual NSDragOperation draggingUpdated(id sender); virtual void draggingExited(id sender); virtual BOOL prepareForDragOperation(id sender); - virtual BOOL performDragOperation(id sender); + virtual BOOL performDragOperation(); virtual void concludeDragOperation(id sender); /* If multiple actions are supported by the drag source and
