Apache OpenOffice (AOO) Bugzilla – Issue 122497
Can't drag gallery to in Calc on Mac
Last modified: 2017-05-20 11:42:18 UTC
Build :AOO400m2(Build:9701) - Rev. 1489073 on Mac OS Step: 1. New a spreadsheet 2. Drag picture from gallery Issue: Fail to add picture by dragging In writer and presentation on Mac ,it passed In Calc on Windows7 ,it passed
The Calc edit view does not accept the gallery graphic. The graphic can still be inserted via the context menu (Insert -> Copy).
ALG: Taking a look. Indeed, simple drag on mac in calc shows the symbol that indicates that the D&D is not accepted. Pressing CTRL+SHIFT works, and D&D on existing draw objects (holding CTRL+ALT) works, too. Taking a look...
ALG: Pressing any of the qualifier keys CTRL, ALT or CMD, makes it work. Checked GalleryTransferable::AddSupportedFormats, the correct formats are added. Checked ScGridWindow::AcceptDrop, the correct actions arrive, but nMyAction (and thus rEvt.mnAction) is on '5' which is wrong. Allowed values are from ::com::sun::star::datatransfer::dnd::DNDConstants and allow 0..4 and 0x80. Need to check how this happens (probably on the system-dependent side of things)...
ALG: On mac SystemToOfficeDragActions is used to convert between mac D&D actions and ::com::sun::star::datatransfer::dnd::DNDConstants. This method shows why a '5' is set in ScGridWindow::AcceptDrop in nMyAction; the value is a flag-value, not a numerical one. Thus the switch/case in ScGridWindow::AcceptDrop is basically wrong, but has to use the values as flag values. I am only curious why this ever had worked; maybe DND_ACTION_LINK was added in the near past somehow...?
ALG: Adding hdu to cc, he may know more if in the close past the mac D&D actions might have expanded.
ALG: Checked in sd, mnAction is handled as flag values. Sw is using a mix of comparisons and flag handling, (hopefully) filtering everywhere before usage as needed. Adapting code in Sc to handle as flag values, too...
ALG: Added filtering to ScGridWindow::ExecuteDrop, added handling to have direct D&D for objects. Checking on other plattforms...
ALG: Checked commited change on win, looks well, done.
LG: Also checked on linux, looks good, too.
grant showstopper flag, fixed already
Verify on Mac on Rev. 1499347