Kaydet (Commit) cfdd89f1 authored tarafından mmeof2's avatar mmeof2 Kaydeden (comit) Caolán McNamara

tdf#44621: Fixed drag and drop in OSX 10.7+

Change-Id: Iefcc529d8ffa608e26c75a445341e0b8ae11c613
Reviewed-on: https://gerrit.libreoffice.org/15683Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 8908f10f
...@@ -105,7 +105,8 @@ namespace /* private */ ...@@ -105,7 +105,8 @@ namespace /* private */
-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender -(BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{ {
return mDropTarget->performDragOperation(sender); (void) sender;
return mDropTarget->performDragOperation();
} }
-(void)concludeDragOperation:(id <NSDraggingInfo>)sender -(void)concludeDragOperation:(id <NSDraggingInfo>)sender
...@@ -201,7 +202,10 @@ NSDragOperation DropTarget::draggingEntered(id sender) ...@@ -201,7 +202,10 @@ NSDragOperation DropTarget::draggingEntered(id sender)
sal_Int8 currentAction = determineDropAction(mDragSourceSupportedActions, sender); sal_Int8 currentAction = determineDropAction(mDragSourceSupportedActions, sender);
NSRect bounds = [mView bounds]; 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); CocoaToVCL(dragLocation, bounds);
...@@ -239,7 +243,10 @@ NSDragOperation DropTarget::draggingUpdated(id sender) ...@@ -239,7 +243,10 @@ NSDragOperation DropTarget::draggingUpdated(id sender)
{ {
sal_Int8 currentAction = determineDropAction(currentDragSourceActions, sender); sal_Int8 currentAction = determineDropAction(currentDragSourceActions, sender);
NSRect bounds = [mView bounds]; 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); CocoaToVCL(dragLocation, bounds);
...@@ -288,7 +295,7 @@ BOOL DropTarget::prepareForDragOperation() ...@@ -288,7 +295,7 @@ BOOL DropTarget::prepareForDragOperation()
return 1; return 1;
} }
BOOL DropTarget::performDragOperation(id sender) BOOL DropTarget::performDragOperation()
{ {
bool bSuccess = false; bool bSuccess = false;
...@@ -302,7 +309,10 @@ BOOL DropTarget::performDragOperation(id sender) ...@@ -302,7 +309,10 @@ BOOL DropTarget::performDragOperation(id sender)
} }
NSRect bounds = [mView bounds]; 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); CocoaToVCL(dragLocation, bounds);
......
...@@ -125,7 +125,7 @@ public: ...@@ -125,7 +125,7 @@ public:
NSDragOperation draggingUpdated(id sender); NSDragOperation draggingUpdated(id sender);
void draggingExited(id sender); void draggingExited(id sender);
static BOOL prepareForDragOperation(); static BOOL prepareForDragOperation();
BOOL performDragOperation(id sender); BOOL performDragOperation();
void concludeDragOperation(id sender); void concludeDragOperation(id sender);
/* If multiple actions are supported by the drag source and /* If multiple actions are supported by the drag source and
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment