From 2542cafbe680fdaf2ed9f955e6129a70bf310f6f Mon Sep 17 00:00:00 2001 From: Jaume Pujantell Date: Mon, 18 Mar 2024 12:04:36 +0100 Subject: [PATCH] clipboard: do no compare wth invalid metapath Copying from a document, closing it, reopening it and then pasting did nothing. The short-circuit for internal paste gave a false positive. Signed-off-by: Jaume Pujantell Change-Id: Ib21faf270d2ed03af2954f79bee8c1efbb0fd0ca --- browser/src/map/Clipboard.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/browser/src/map/Clipboard.js b/browser/src/map/Clipboard.js index ea572e34aec4..020858f83f80 100644 --- a/browser/src/map/Clipboard.js +++ b/browser/src/map/Clipboard.js @@ -92,6 +92,8 @@ L.Clipboard = L.Class.extend({ getMetaPath: function(idx) { if (!idx) idx = 0; + if (this._accessKey[idx] === '') + return ''; var metaPath = '/cool/clipboard?WOPISrc=' + encodeURIComponent(this._map.options.doc) + '&ServerId=' + app.socket.WSDServer.Id + @@ -380,7 +382,7 @@ L.Clipboard = L.Class.extend({ // for the paste, we always prefer the internal LOK's copy/paste if (preferInternal === true && - (meta.indexOf(id) >= 0 || meta.indexOf(idOld) >= 0)) + ((id !== '' && meta.indexOf(id) >= 0) || (idOld !== '' && meta.indexOf(idOld) >= 0))) { // Home from home: short-circuit internally. window.app.console.log('short-circuit, internal paste, new style? ' + newStyle);