[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4-0' - loleaflet/src

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri May 17 13:50:24 UTC 2019


 loleaflet/src/layer/tile/TileLayer.js |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 5a160ba0c0504f65bdfb3b0def9f39637b8b7e4b
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Fri May 17 13:42:00 2019 +0200
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Fri May 17 15:50:07 2019 +0200

    Prefer HTML over RTF for pasting on the Mac.
    
    Safari provides RTF clipboard content which doesn't contain the images.
    We do not know where the content comes from, so let's always prefer HTML
    over RTF on Mac.
    
    Change-Id: I2f449ff4cf025e5f51dbe6e0683667f2d319ac21
    Reviewed-on: https://gerrit.libreoffice.org/72461
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 2998ab914e057d5c9bae3e3b03c0cf5f13e531b9)
    Reviewed-on: https://gerrit.libreoffice.org/72480

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index f39102829..00759ca65 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2384,6 +2384,16 @@ L.TileLayer = L.GridLayer.extend({
 				['text/plain', 'text/plain;charset=utf-8'],
 				['Text', 'text/plain;charset=utf-8']
 			];
+		} else if (navigator.platform.startsWith('Mac')) {
+			// Safari provides RTF clipboard content which doesn't contain the
+			// images.  We do not know where the content comes from, so let's
+			// always prefer HTML over RTF on Mac.
+			mimeTypes = [
+				['text/html', 'text/html'],
+				['text/rtf', 'text/rtf'],
+				['text/plain', 'text/plain;charset=utf-8'],
+				['Text', 'text/plain;charset=utf-8']
+			];
 		} else {
 			mimeTypes = [
 				['text/rtf', 'text/rtf'],


More information about the Libreoffice-commits mailing list