DropTarget.cxx (2dae3561) DropTarget.cxx (f9bb485f)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 119 unchanged lines hidden (view full) ---

128-(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
129{
130 return mDropTarget->prepareForDragOperation(sender);
131}
132
133
134-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender
135{
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 119 unchanged lines hidden (view full) ---

128-(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
129{
130 return mDropTarget->prepareForDragOperation(sender);
131}
132
133
134-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender
135{
136 return mDropTarget->performDragOperation(sender);
136 (void) sender;
137 return mDropTarget->performDragOperation();
137}
138
139
140-(void)concludeDragOperation:(id <NSDraggingInfo>)sender
141{
142 mDropTarget->concludeDragOperation(sender);
143}
144

--- 85 unchanged lines hidden (view full) ---

230
231 // Only if the drop target is really interessted in the drag actions
232 // supported by the source
233 if (mDragSourceSupportedActions & mDefaultActions)
234 {
235 sal_Int8 currentAction = determineDropAction(mDragSourceSupportedActions, sender);
236
237 NSRect bounds = [mView bounds];
138}
139
140
141-(void)concludeDragOperation:(id <NSDraggingInfo>)sender
142{
143 mDropTarget->concludeDragOperation(sender);
144}
145

--- 85 unchanged lines hidden (view full) ---

231
232 // Only if the drop target is really interessted in the drag actions
233 // supported by the source
234 if (mDragSourceSupportedActions & mDefaultActions)
235 {
236 sal_Int8 currentAction = determineDropAction(mDragSourceSupportedActions, sender);
237
238 NSRect bounds = [mView bounds];
238 NSPoint dragLocation = [sender draggedImageLocation];
239
239 NSPoint mouseLoc = [NSEvent mouseLocation];
240
241 id wnd = [mView window];
242 NSPoint dragLocation = [mView convertPoint:[wnd convertScreenToBase:mouseLoc] fromView:nil];
243
240 CocoaToVCL(dragLocation, bounds);
244 CocoaToVCL(dragLocation, bounds);
241
245
242 sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x);
243 sal_Int32 posY = static_cast<sal_Int32>(dragLocation.y);
244
245 NSPasteboard* dragPboard = [sender draggingPasteboard];
246 mXCurrentDragClipboard = new AquaClipboard(dragPboard, false);
247
248 uno::Reference<XTransferable> xTransferable = DragSource::g_XTransferable.is() ?
249 DragSource::g_XTransferable : mXCurrentDragClipboard->getContents();

--- 19 unchanged lines hidden (view full) ---

269 sal_Int8 currentDragSourceActions =
270 SystemToOfficeDragActions([sender draggingSourceOperationMask]);
271 NSDragOperation dragOp = NSDragOperationNone;
272
273 if (currentDragSourceActions & mDefaultActions)
274 {
275 sal_Int8 currentAction = determineDropAction(currentDragSourceActions, sender);
276 NSRect bounds = [mView bounds];
246 sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x);
247 sal_Int32 posY = static_cast<sal_Int32>(dragLocation.y);
248
249 NSPasteboard* dragPboard = [sender draggingPasteboard];
250 mXCurrentDragClipboard = new AquaClipboard(dragPboard, false);
251
252 uno::Reference<XTransferable> xTransferable = DragSource::g_XTransferable.is() ?
253 DragSource::g_XTransferable : mXCurrentDragClipboard->getContents();

--- 19 unchanged lines hidden (view full) ---

273 sal_Int8 currentDragSourceActions =
274 SystemToOfficeDragActions([sender draggingSourceOperationMask]);
275 NSDragOperation dragOp = NSDragOperationNone;
276
277 if (currentDragSourceActions & mDefaultActions)
278 {
279 sal_Int8 currentAction = determineDropAction(currentDragSourceActions, sender);
280 NSRect bounds = [mView bounds];
277 NSPoint dragLocation = [sender draggedImageLocation];
281 NSPoint mouseLoc = [NSEvent mouseLocation];
278
282
283 id wnd = [mView window];
284 NSPoint dragLocation = [mView convertPoint:[wnd convertScreenToBase:mouseLoc] fromView:nil];
285
279 CocoaToVCL(dragLocation, bounds);
280
281 sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x);
282 sal_Int32 posY = static_cast<sal_Int32>(dragLocation.y);
283
284 DropTargetDragEvent dtde(static_cast<OWeakObject*>(this),
285 0,
286 this,

--- 34 unchanged lines hidden (view full) ---

321
322
323BOOL DropTarget::prepareForDragOperation(id /*sender*/)
324{
325 return 1;
326}
327
328
286 CocoaToVCL(dragLocation, bounds);
287
288 sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x);
289 sal_Int32 posY = static_cast<sal_Int32>(dragLocation.y);
290
291 DropTargetDragEvent dtde(static_cast<OWeakObject*>(this),
292 0,
293 this,

--- 34 unchanged lines hidden (view full) ---

328
329
330BOOL DropTarget::prepareForDragOperation(id /*sender*/)
331{
332 return 1;
333}
334
335
329BOOL DropTarget::performDragOperation(id sender)
336BOOL DropTarget::performDragOperation()
330{
331 bool bSuccess = false;
332
333 if (mSelectedDropAction != DNDConstants::ACTION_NONE)
334 {
335 uno::Reference<XTransferable> xTransferable = DragSource::g_XTransferable;
336
337 if (!DragSource::g_XTransferable.is())
338 {
339 xTransferable = mXCurrentDragClipboard->getContents();
340 }
341
342 NSRect bounds = [mView bounds];
337{
338 bool bSuccess = false;
339
340 if (mSelectedDropAction != DNDConstants::ACTION_NONE)
341 {
342 uno::Reference<XTransferable> xTransferable = DragSource::g_XTransferable;
343
344 if (!DragSource::g_XTransferable.is())
345 {
346 xTransferable = mXCurrentDragClipboard->getContents();
347 }
348
349 NSRect bounds = [mView bounds];
343 NSPoint dragLocation = [sender draggedImageLocation];
350 NSPoint mouseLoc = [NSEvent mouseLocation];
344
351
352 id wnd = [mView window];
353 NSPoint dragLocation = [mView convertPoint:[wnd convertScreenToBase:mouseLoc] fromView:nil];
354
345 CocoaToVCL(dragLocation, bounds);
346
347 sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x);
348 sal_Int32 posY = static_cast<sal_Int32>(dragLocation.y);
349
350 DropTargetDropEvent dtde(static_cast<OWeakObject*>(this),
351 0,
352 this,

--- 247 unchanged lines hidden ---
355 CocoaToVCL(dragLocation, bounds);
356
357 sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x);
358 sal_Int32 posY = static_cast<sal_Int32>(dragLocation.y);
359
360 DropTargetDropEvent dtde(static_cast<OWeakObject*>(this),
361 0,
362 this,

--- 247 unchanged lines hidden ---