Issue 124951 - insert graphic from gallery is inserted as linked graphic by default
Summary: insert graphic from gallery is inserted as linked graphic by default
Alias: None
Product: Impress
Classification: Application
Component: editing (show other issues)
Version: 4.0.1
Hardware: All Mac OS X, all
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2014-05-21 15:31 UTC by jsc
Modified: 2017-05-20 10:44 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.1.0
Developer Difficulty: ---

first shot of adjusting the DND flags on Mac (2.21 KB, patch)
2014-07-10 12:46 UTC,
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description jsc 2014-05-21 15:31:56 UTC
On my macos 10.9.3 system and AOO 4.1.0 images from the gallery inserted via  drag&drop are inserted as linked graphic by default. This is wrong and the default shoudl be embedded as it is for example in Writer.

Linked graphics are confusing as default for most users and exchanging such documents will lose the graphics. The average user will be lost.
Comment 1 Ariel Constenla-Haile 2014-05-29 22:22:19 UTC
Already reproducible with 4.0.1 (don't have older versions to test).
Comment 2 Armin Le Grand 2014-06-26 11:55:05 UTC
Checked Writer and Calc, happens only in Draw/Impress. Checking what happens on insertion...
Comment 3 Armin Le Grand 2014-06-26 13:18:11 UTC
Found a significannt difference; while on win the insertion happens using View::ExecuteDrop on the mac the View::DropInsertFileHdl is used which indeed gets an nAction==5 which means ACTION_COPY|ACTION_LINK. This is triggered using DropInsertFileHdl using the timer maDropInsertFileTimer, thus triggered from sd::View::InsertData.
Both OSes execute using sd::View::InsertData, the diff is that for mac the given rDnDAction==5 and for Win it's 1. Patching the mac version to 1 executes the same as the in version. Thus the question is where the '5' comes from...
Comment 4 Armin Le Grand 2014-06-26 14:09:52 UTC
Reason is that the ExecuteDropEvent feeded to Window::ExecuteDrop has mnAction==5 already set. The mechanism starts at GalleryTheme::StartDrag where as 2nd parameter the allowed actions (here DND_ACTION_COPY|DND_ACTION_LINK) is used which is 5.
On Windows there is system-dependent code in project transfer which filters this allowed actions using the current pressed keys (see dtrans/source/win32.dnd:461 DropTarget::Drop and how it uses 'getFilteredActions' to reduce the allowed DND_ACTION* to the concrete ones depending on pressed keys).

@Herbert: On Mac I could *not* find system-dependent code to reduce from the allowed flags to the current flags, thus '5' (or copy *and* link) stay and will be used in the drop implementations. What needs to be filled somewhere with the filtered value is a ::com::sun::star::datatransfer::dnd::DropTargetDropEvent.DropAction. Maybe that code is missing...?
I found DropTarget::performDragOperation in vcl where mSelectedDropAction seems to be used, but I do not know if the mentioned filtering is done.
Comment 5 2014-07-10 12:46:58 UTC
Created attachment 83673 [details]
first shot of adjusting the DND flags on Mac

@alg: The patch doesn't yet fully work, but it gives a good idea on how to filter drag-and-drop actions on Mac depending on the status of the keyboard-modifier keys.
Comment 6 Marcus 2017-05-20 10:44:59 UTC
Reset the assignee to the default "".