Bug 135669 - EDITING: Drag and drop from Windows Explorer to Writer does not make OLE object
Summary: EDITING: Drag and drop from Windows Explorer to Writer does not make OLE object
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Dániel Arató (NISZ)
Whiteboard: target:7.1.0
Depends on:
Blocks: OLE-Objects
  Show dependency treegraph
Reported: 2020-08-12 13:28 UTC by NISZ LibreOffice Team
Modified: 2021-05-04 11:12 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:

Screenshot of the problem in Writer: I dropped a file there, can you see it? (129.35 KB, image/png)
2020-08-12 13:28 UTC, NISZ LibreOffice Team

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-08-12 13:28:20 UTC
Created attachment 164208 [details]
Screenshot of the problem in Writer: I dropped a file there, can you see it?

When a file is dropped from the Windows Explorer to Word it gets inserted as an OLE object at the drop point.
When a file is dropped to Writer nothing happens.

It would be intuitive for users to have this behavior. In our environment many people use this method to create a "main" document with a bunch of attachments embedded into it then send this "main" document around as a single file.

Steps to reproduce:
    1. Open a new document in both Word and in Writer
    2. Drag an XLSX (or other non-text office document) file into the new documents from the Windows Explorer

Actual results:
In Writer nothing happens.

Expected results:
OLE object should be inserted.

LibreOffice details:
Version: (x64)
Build ID: <buildversion>
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL

Also in older versions all the way back to: 
LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 1 V Stuart Foote 2020-08-12 13:59:58 UTC
The OLE insertion works fine [1], just the os/DE GUI drag-n-drop does not.

Seems like this would require a lot of native code to do cross platform. 


[1] Insert -> Object -> OLE Object... with 'Create from file' radio button, and 'Link to file' checkbox. And for only an icon the 'Display as icon' checkbox.
Comment 2 Mike Kaganski 2020-08-12 14:04:15 UTC
Disagree with WF. This might be not a priority, but if someone wants to implement this ... anyway, DnD code is highly platform-specific anyway, and possibly the implementation would not be that much an effort (didn't check, just imagine that existing DND could already provide the data - file name(s) - needed to add OLE insertion).
Comment 3 Mike Kaganski 2020-08-12 14:13:02 UTC
Additional info:

LO already implements DND documents into its main window (to open them); images into documents (to insert them). So much of functionality is already there.

For *some* dragged objects, Word creates an OLE object of type/progId "Package". LibreOffice includes own cross-platform implementation for handling (unpacking) that object type: see tdf#104065.

Based on that, having file names from DnD, it looks reasonably doable to implement insertion of such objects in a platform-independent way.
Comment 4 Regina Henschel 2020-08-12 16:45:05 UTC
DnD creates an OLE-Object in Draw/Impress and in Calc, why not in Writer too? I disagree with WF.
Comment 5 V Stuart Foote 2020-08-12 19:34:42 UTC
(In reply to Regina Henschel from comment #4)
> DnD creates an OLE-Object in Draw/Impress and in Calc, why not in Writer
> too? I disagree with WF.

Oops, your right as usual Regina. The DnD opens/unpacks the document onto sd Draw/Impress or sc Calc cell--why not to sw Writer canvas? So guess that is actually a bug? Checked and the DnD behavior (no response) is inherited from OOo with LO release.

But also, the DnD OLE gets default handling of copying into document (not linked), and of extracting into an OLE frame (no Icon view). 

A bit unwieldy compared to precision of "OLE Object..." insertion dialog--and maybe not what folks used to the MSO way expect being dropped as an Icon. When we do the same with an .ODT being DnD it by default is placed as a Section--rather than an OLE object.
Comment 6 Heiko Tietze 2020-08-13 11:35:23 UTC
Agreement on NEW, no further input from UX required.
Comment 7 Commit Notification 2020-09-14 10:52:25 UTC
Daniel Arato (NISZ) committed a patch related to this issue.
It has been pushed to "master":


tdf#135669 sw: drag and drop other files as OLE

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.
Comment 8 László Németh 2020-09-14 10:55:17 UTC
Maybe we want to insert DOCX documents in sections, like in the case of ODTs, especially if LibreOffice doesn't keep the original DOCX document after OLE insertion. This is a more natural way to insert a text document into a text document, also the users could notice the possible layout loss of a multi-page DOCX before saving it via Save As of the local menu of the OLE object.
Comment 9 László Németh 2020-09-14 11:02:50 UTC
"linked" is the default setting of inserting ODT files. This doesn't change the original DOCX file, but it doesn't embed into the ODT (or DOCX?).