Bug 137905 - macOS clipboard handling, copying and pasting text from Word into Writer pastes an image, other formats available on Paste Special
Summary: macOS clipboard handling, copying and pasting text from Word into Writer past...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.6.2 release
Hardware: Other macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 128580 (view as bug list)
Depends on:
Blocks: Paste Clipboard
  Show dependency treegraph
 
Reported: 2020-11-01 13:52 UTC by Daniele
Modified: 2022-12-21 12:53 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Image of pasted text (77.39 KB, image/png)
2020-11-01 13:52 UTC, Daniele
Details
Paste special clipboard content from Word 365/2019 on Windows os (114.79 KB, image/png)
2020-11-01 17:45 UTC, V Stuart Foote
Details
All flavors by ClipboardViewer (221.11 KB, image/png)
2020-12-16 10:58 UTC, siramon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniele 2020-11-01 13:52:01 UTC
Description:
Libreoffice Writer: When editing, i.e. copiyng a portion of text in Word to paste it in libreoffice, instead of text one has an image. But if one is to chose the "Paste special" option Libreoffice gives clicking with the right button of the mouse, the text is pasted. I am in safe mode, but before I restarted in safe mode the behavior was the same. (Formatting)

Steps to Reproduce:
1. Open Word for Mac version 16.42 (20101102) Microsoft 365 subscription
2. Paste some text there 
3. Ctrl + C
4. Go to Libreoffice
5. Ctrl + V

Actual Results:
An image is pasted

Expected Results:
Text should be pasted


Reproducible: Always


User Profile Reset: Yes



Additional Info:
- Tried disabling OpenCL in preferences, but despite being checked it was not being used. I unchecked the box anyway and restarted. The problem persists.
- Pasting from Mac memo, Note pad, writer is no problem
- Pasting from Google docs is no problem.
Comment 1 Daniele 2020-11-01 13:52:57 UTC
Created attachment 166904 [details]
Image of pasted text
Comment 2 V Stuart Foote 2020-11-01 17:45:00 UTC
Created attachment 166910 [details]
Paste special clipboard content from Word 365/2019 on Windows os

Can not confirm on Windows builds recent master/7.1.0

Default paste is expected text string, Calibri of Word 365/2019 is received as unformatted text.

Attached shows the Special Paste dialog for when I select the text in Word 365, the content of the system clipboard shows the formats Word 365 prvides.

macOS flavor of MS Word should provide similar, with similar priorities.

Need to see the clipboard content for macOS instance of MS Word, otherwise this is really NOT A BUG as OP reports the Unformatted Text is available as a Paste format.
Comment 3 V Stuart Foote 2020-11-01 18:01:20 UTC
For OP, could you find some Clipboard viewer to get a look at what the macOS flavor of Word is placing on the system "Clipboard" pasteboard, it might help to spot an issue. 

=-ref-=
something like this:

https://langui.net/clipboard-viewer/
Comment 4 Daniele 2020-11-13 12:09:50 UTC
Hi, thank you V Stuart Foote, I downloaded the program, reproduced the bug from Word into Libreoffice, and then opened Clipboard Viewer.
Here is the result. I hope it helps:

.....Luôõd@K.ôg.2¬...................... ...4...l...D.o.c.u.m.e.n.t.o. .d.i. .M.i.c.r.o.s.o.f.t. .W.o.r.d...h.t.t.p.s.:././.d...d.o.c.s...l.i.v.e...n.e.t./.e.e.5.2.6.f.2.2.6.8.a.a.4.1.5.e./.D.O.W.N.L.O.A.D.S.%.2.0.(.D.E.%.2.0.E.N.%.2.0.E.S.%.2.0.F.R.%.2.0.I.T.)./.O.n.D.%.2.0.A.r.t.i.c.l.e.s./.J.G.-.X...M.0.0.0.2.-.f.r.a.-.S.p.e.y.r...%.2.0.P.l.a.n.%.2.0.d.e.%.2.0.l.. S.u.v.r.e...d.o.c.x...
Comment 5 V Stuart Foote 2020-11-13 15:27:20 UTC
(In reply to Daniele from comment #4)
> Hi, thank you V Stuart Foote, I downloaded the program, reproduced the bug
> from Word into Libreoffice, and then opened Clipboard Viewer.
> Here is the result. I hope it helps:
> 

Thanks for trying, unfortunately would need more detail as to which other formats are held in on the pasteboard, should be multiple flavors of the copied element.

Potential exists to adjust the clipboard format priority for the macOS builds to prefer a text format to an image format for the default paste.
Comment 6 Thorsten Wagner 2020-11-15 00:41:44 UTC
Issue is reproducible with

Version: 7.0.3.1.0+
Build ID: 98548d3c12a00cb27729e88a99d5976db1e05f5e
CPU threads: 8; OS: Mac OS X 10.15.7; UI render: GL; VCL: osx
Locale: de-DE (en_US.UTF-8); UI: en-US
Calc: threaded

As copying between MS Word and MS Word or MS Excel results in pasted text, different flavors seem to exist within clipboard.
Comment 7 siramon 2020-12-16 10:58:06 UTC
Created attachment 168218 [details]
All flavors by ClipboardViewer

Reproducible with the following settings

MacOS: 10.15.7
Word: 16.43
Writer: 7.0.3.1

For which flavor do you need more details @V Stuart Foote?
Comment 8 V Stuart Foote 2020-12-16 14:39:29 UTC
(In reply to siramon from comment #7)
> Created attachment 168218 [details]
> All flavors by ClipboardViewer
> 
> Reproducible with the following settings
> 
> MacOS: 10.15.7
> Word: 16.43
> Writer: 7.0.3.1
> 
> For which flavor do you need more details @V Stuart Foote?

If that list from 'Clipboard Viewer' had been cleared and was only the result for a simple Ctrl + C copy out of MS Word (as steps of comment 0) -- then should suffice.  Was it?

Fixing requires identifying the content on clipboard that we want to paste preferentially and assigning it the highest priority.
Comment 9 siramon 2020-12-16 16:46:56 UTC
I cleared before. This (huge) list is really just the copy from MS-Word.

If you need details regarding a special flavor, just tell me. In the screenshot you see the result from the "public.utf8-plain-text" flavor.
Comment 10 steve 2021-08-13 09:45:54 UTC
Setting to new as per confirmation in comment 6
Comment 11 Jessica 2021-09-09 06:54:05 UTC Comment hidden (spam)
Comment 12 Dieter 2022-06-18 04:51:40 UTC
Perhaps duplicate of bug 128580?
Comment 13 Thomas Tempelmann 2022-10-21 20:39:11 UTC
@Dieter: Yes, this is a duplicate of 128580

And I can confirm that this still happens.

I'm the author of a clipboard (history) recorder and have quite a lot of experience in this field, as I have to work around constantly about quirks with Office apps (and now LO, too).

I have a tool to view the clipboard contents (but there's also one from Apple): http://www.tempel.org/ShowClipboards

With that you can see that Word places these types into the clipboard, in order, from the Carbon Pasteboard API:

com.microsoft.Object-Descriptor
public.rtf (RTF )
public.utf16-external-plain-text (ut16)
dyn.ah62d4rv4gk81n65yru (ustl)
com.apple.traditional-mac-plain-text (TEXT)
dyn.ah62d4rv4gk81g7d3ru (styl)
public.html (HTML)
public.utf16-plain-text (utxt)
com.adobe.pdf (PDF )
com.microsoft.Embed-Source
com.microsoft.Link-Source
com.microsoft.Link-Source-Descriptor
com.microsoft.ObjectLink
com.microsoft.HyperlinkWordBkmk
com.apple.webarchive (weba)
public.utf8-plain-text (utf8)
com.microsoft.ole.source.30211.0x10a61fce0
com.microsoft.DataObject
com.microsoft.appbundleid
dyn.agk81n65yru (ustl)
dyn.agk81g7d3ru (styl)

Programs who support Paste should look for the types, and if they support multiple types, prefer the former to the latter types (this isn't clearly stated in recent Apple docs, unfortunately). In other words, a program writing to the clipboard should put the richest data first.

I suspect that LO picks the PDF from this list, whereas it should prefer the RTF or HTML instead.
Comment 14 Thomas Tempelmann 2022-10-21 20:39:56 UTC
*** Bug 128580 has been marked as a duplicate of this bug. ***