View | Details | Raw Unified | Return to issue 124951
Collapse All | Expand All

(-)main/vcl/aqua/source/dtrans/DropTarget.cxx (-22 / +26 lines)
Lines 328-367 BOOL DropTarget::prepareForDragOperation(id /*sender*/) Link Here
328
328
329
BOOL DropTarget::performDragOperation(id sender)
329
BOOL DropTarget::performDragOperation(id sender)
330
{
330
{
331
  bool bSuccess = false;
331
	// emulate dtrans' dndOleKeysToAction() on Mac
332
332
	sal_Int8 nFilteredDropAction = mSelectedDropAction;
333
  if (mSelectedDropAction != DNDConstants::ACTION_NONE)
333
	if( (mpFrame->mnLastModifierFlags & (NSShiftKeyMask|NSCommandKeyMask)) == 0 )
334
	{
334
	{
335
	    uno::Reference<XTransferable> xTransferable = DragSource::g_XTransferable;
335
		nFilteredDropAction &= ~DNDConstants::ACTION_LINK;
336
		nFilteredDropAction |= DNDConstants::ACTION_COPY;
337
	}
336
338
337
	  if (!DragSource::g_XTransferable.is())			
339
	// short circut if there is nothing to do
338
		{
340
	if( mSelectedDropAction == DNDConstants::ACTION_NONE)
339
		  xTransferable = mXCurrentDragClipboard->getContents();
341
		return false;
340
		}
341
		  
342
	  NSRect bounds = [mView bounds];
343
	  NSPoint dragLocation = [sender draggedImageLocation];
344
342
345
	  CocoaToVCL(dragLocation, bounds);
343
	// create the DropTargetEvent
346
344
347
	  sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x);
345
	uno::Reference<XTransferable> xTransferable = DragSource::g_XTransferable;
348
	  sal_Int32 posY = static_cast<sal_Int32>(dragLocation.y);
346
	if (!DragSource::g_XTransferable.is())			
347
		xTransferable = mXCurrentDragClipboard->getContents();
348
 
349
	const NSRect bounds = [mView bounds];
350
	NSPoint dragLocation = [sender draggedImageLocation];
351
352
	CocoaToVCL(dragLocation, bounds);
349
353
350
	  DropTargetDropEvent dtde(static_cast<OWeakObject*>(this),
354
	const sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x);
355
	const sal_Int32 posY = static_cast<sal_Int32>(dragLocation.y);
356
357
	DropTargetDropEvent dtde(static_cast<OWeakObject*>(this),
351
							   0,
358
							   0,
352
							   this,
359
							   this,
353
							   mSelectedDropAction,
360
							   nFilteredDropAction,
354
							   posX,
361
							   posX,
355
							   posY, 
362
							   posY, 
356
							   mDragSourceSupportedActions,
363
							   mDragSourceSupportedActions,
357
							   xTransferable);
364
							   xTransferable);
358
		  
365
	// handle the event
359
	  fire_drop(dtde);
366
	fire_drop(dtde);
360
361
	  bSuccess = true;
362
	}
363
367
364
  return bSuccess;
368
	return true;
365
}
369
}
366
370
367
371

Return to issue 124951