Bug 135546 - Pictures lost if cut and pasted (into Writer) from MacOS Notes
Summary: Pictures lost if cut and pasted (into Writer) from MacOS Notes
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.7.3 release
Hardware: x86-64 (AMD64) macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Paste
  Show dependency treegraph
 
Reported: 2020-08-08 00:01 UTC by Steve
Modified: 2025-07-08 22:28 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve 2020-08-08 00:01:13 UTC
Description:
After selecting and copying the contents of a 'note' from within MacOS Notes, I tried to paste the contents into a new LibreOffice Writer document.  Only the text appeared and the images were lost.

Steps to Reproduce:
1. Open MacOS Notes and create a new note
2. Add both text and images into the note
3. Choose "Edit | Select All" in the note
4. Choose "Edit | Copy"
5. Open LibreOffice and create a new Writer document
6. Click in the new Writer document and select "Edit | Paste"
7. The cut & pasted text appears, but the images do not

Actual Results:
Only the text appears after the paste operation.  The text appears properly formatted and has vertical space where the images should be, however, the images are not present.

Expected Results:
I would expect that both the copied text and images should have appeared in the Writer document.


Reproducible: Always


User Profile Reset: No



Additional Info:
I performed the same test with MS Word for Mac version 16.34 and the text and images were both present and appeared as they did in the MacOS Notes note.  Also, I mentioned above that once pasted into the Writer doc, that the text appeared and vertical space appeared where the images should have been.  I also tried to select the images and while there was vertical space, it did not appear that there were any images to be selected.  I'm guessing the images were lost at some point even though some vertical space was allocated for them.  I am experiencing these results in MacOS Catalina.
Comment 1 Roman Kuznetsov 2020-09-16 19:58:00 UTC
confirm in

Version: 7.1.0.0.alpha0+
Build ID: 8c18cd6823ddf4ef5ba67801a84cee26c9b5a9a6
CPU threads: 4; OS: Mac OS X 10.15.6; UI render: default; VCL: osx
Locale: ru-RU (ru_RU.UTF-8); UI: en-US
Calc: threaded
Comment 2 Roman Kuznetsov 2020-09-16 20:00:12 UTC
the same for 6.0 version in macOS
Comment 3 PD Andrew 2023-03-03 06:09:35 UTC
Same thing happens with LibreOffice Writer document, copying and pasting into an email. None of the pictures are included.
Comment 4 QA Administrators 2025-03-03 03:10:14 UTC Comment hidden (obsolete)
Comment 5 Alec K 2025-07-08 20:53:56 UTC
This bug is still present in:

Version: 25.2.4.3 (AARCH64) / LibreOffice Community
Build ID: 33e196637044ead23f5c3226cde09b47731f7e27
CPU threads: 10; OS: macOS 15.3.1; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 6 Patrick (volunteer) 2025-07-08 22:28:32 UTC
So I can reproduce this bug so I added some debug code to see what data formats macOS Notes posted to the system pasteboard (see debug patch at the end of this comment.

What I found is that when LibreOffice asks the system pasteboard what data flavors are avaialable (i.e. what was copied in Notes), I get the following data formats list:

    "com.apple.notes.richtext",
    "com.apple.flat-rtfd",
    "NeXT RTFD pasteboard type",
    "public.rtf",
    "NeXT Rich Text Format v1.0 pasteboard type",
    "public.utf8-plain-text",
    NSStringPboardType,
    "public.utf16-external-plain-text",
    "CorePasteboardFlavorType 0x75743136"

Most are plain text or RTF. Neither of those formats support inline images. Don't know what "CorePasteboardFlavorType 0x75743136" is but I suspect that it is some internal Notes data format.

That leaves only RTFD data formats. RTFD is a custom extension to RTF created by Apple to handle inline images. LibreOffice, however, does not understand the RTFD format (and neither do I) so it falls back to one of the text formats.

So I really think the bug occurs because LibreOffice doesn't understand Apple's custom RTFD format but does understand the more common HTML format which supports incline images. This is why you can paste text and images from a web browser into LibreOffice: almost all browsers copy the HTML data format to the system pasteboard when copied.

Hopefully, Apple will add HTML to its list of data formats that it posts to the system pasteboard. The other option is to change this bug into a feature request something like "support import and export of RTFD files and pasteboard data".

Below is the debug patch that I used:

diff --git a/vcl/osx/OSXTransferable.cxx b/vcl/osx/OSXTransferable.cxx
index 725c56537a46..7f32bc041939 100644
--- a/vcl/osx/OSXTransferable.cxx
+++ b/vcl/osx/OSXTransferable.cxx
@@ -156,6 +156,7 @@ sal_Bool SAL_CALL OSXTransferable::isDataFlavorSupported(const DataFlavor& aFlav
 void OSXTransferable::initClipboardItemList()
 {
   NSArray* pboardFormats = [mPasteboard types];
+CFShow(pboardFormats);
 
   if (pboardFormats == nullptr)
   {