[Libreoffice-commits] core.git: sot/qa sot/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Sep 18 07:56:56 UTC 2018


 sot/qa/cppunit/test_sot.cxx |    4 ++++
 sot/source/base/formats.cxx |    5 +++++
 2 files changed, 9 insertions(+)

New commits:
commit 3c25e7a31bd8b5b40f86208cd141c6108cb736c5
Author:     Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Mon Sep 17 21:14:57 2018 +0200
Commit:     Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Tue Sep 18 09:56:34 2018 +0200

    tdf#118784 sot: lower priority of RTF clipboard format on macOS
    
    This was a problem since commit 29d4ecf32392bc94ab0ba9e73fd79eba65c23fdb
    (tdf#115574 sot: fix Excel -> Writer paste, 2018-03-29), the root cause
    seems to be that (older?) Safari provides RTF clipboard content which
    simply doesn't contain the images.
    
    Just to back to the old behavior on macOS for now, hopefully the
    problematic RTF producer will go away in the long run.
    
    Change-Id: I5c40b28671978cfbf8593f1cc9775985dffc5030
    Reviewed-on: https://gerrit.libreoffice.org/60641
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins

diff --git a/sot/qa/cppunit/test_sot.cxx b/sot/qa/cppunit/test_sot.cxx
index bc6bc95efab1..57c636de0df5 100644
--- a/sot/qa/cppunit/test_sot.cxx
+++ b/sot/qa/cppunit/test_sot.cxx
@@ -176,9 +176,13 @@ namespace
         // tdf#81835 prefer RTF/HTML over GDI Metafile
         CPPUNIT_ASSERT(FindFormatIndex(pFormats, SotClipboardFormatId::RTF) < FindFormatIndex(pFormats, SotClipboardFormatId::GDIMETAFILE));
         CPPUNIT_ASSERT(FindFormatIndex(pFormats, SotClipboardFormatId::HTML) < FindFormatIndex(pFormats, SotClipboardFormatId::GDIMETAFILE));
+#ifndef MACOSX
         // tdf#115574 prefer RTF over BITMAP (Excel provides a BITMAP we can't
         // read, also Excel paste result used to be an editable table)
         CPPUNIT_ASSERT(FindFormatIndex(pFormats, SotClipboardFormatId::RTF) < FindFormatIndex(pFormats, SotClipboardFormatId::BITMAP));
+#else
+        CPPUNIT_ASSERT(FindFormatIndex(pFormats, SotClipboardFormatId::BITMAP) < FindFormatIndex(pFormats, SotClipboardFormatId::RTF));
+#endif
     }
 
     CPPUNIT_TEST_SUITE_REGISTRATION(SotTest);
diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx
index 692798b5f19e..243bc911ddaa 100644
--- a/sot/source/base/formats.cxx
+++ b/sot/source/base/formats.cxx
@@ -880,13 +880,18 @@ SotAction_Impl const aEXCHG_DEST_SWDOC_FREE_AREA_Copy[] =
     { SotClipboardFormatId::SD_OLE, EXCHG_OUT_ACTION_INSERT_OLE, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
     { SotClipboardFormatId::EMBED_SOURCE, EXCHG_OUT_ACTION_INSERT_OLE, SotExchangeActionFlags::InsertTargetUrl, 0 },
     { SotClipboardFormatId::EMBEDDED_OBJ, EXCHG_OUT_ACTION_INSERT_OLE, SotExchangeActionFlags::InsertTargetUrl, 0 },
+#ifndef MACOSX
     { SotClipboardFormatId::RTF, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertTargetUrl, 0 },
+#endif
     { SotClipboardFormatId::PNG, EXCHG_OUT_ACTION_INSERT_BITMAP, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
     { SotClipboardFormatId::JPEG, EXCHG_OUT_ACTION_INSERT_BITMAP, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
     { SotClipboardFormatId::BITMAP, EXCHG_OUT_ACTION_INSERT_BITMAP, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
     { SotClipboardFormatId::HTML, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
     { SotClipboardFormatId::HTML_NO_COMMENT, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
     { SotClipboardFormatId::HTML_SIMPLE, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
+#ifdef MACOSX
+    { SotClipboardFormatId::RTF, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertTargetUrl, 0 },
+#endif
     { SotClipboardFormatId::NETSCAPE_IMAGE, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertTargetUrl, 0 },
     { SotClipboardFormatId::STRING, EXCHG_OUT_ACTION_INSERT_STRING, SotExchangeActionFlags::InsertTargetUrl, 0 },
     { SotClipboardFormatId::NETSCAPE_BOOKMARK, EXCHG_OUT_ACTION_INSERT_HYPERLINK, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },


More information about the Libreoffice-commits mailing list