Skip to content

Commit

Permalink
clipboard: do no compare wth invalid metapath
Browse files Browse the repository at this point in the history
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 <jaume.pujantell@collabora.com>
Change-Id: Ib21faf270d2ed03af2954f79bee8c1efbb0fd0ca
  • Loading branch information
Jaume Pujantell committed Mar 22, 2024
1 parent 5568cee commit 2542caf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion browser/src/map/Clipboard.js
Expand Up @@ -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 +
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 2542caf

Please sign in to comment.