loleaflet/src/map/Clipboard.js |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 76030544269d6b8d03919098cb4187baf383081e
Author:     Szymon Kłos <[email protected]>
AuthorDate: Tue Jul 7 09:31:36 2020 +0200
Commit:     Aron Budea <[email protected]>
CommitDate: Tue Jul 7 19:55:18 2020 +0200

    clipboard: no stub message when copy is disabled
    
    When copy is disabled don't put stub message about
    download button in the clipboard.
    Allow internal copy & paste when copy is disabled
    - so disable only external interaction.
    
    Change-Id: Ie7864abc8a239aa068880545cf09a48155ebbaea
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98237
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Szymon Kłos <[email protected]>
    (cherry picked from commit 39d5d55d719730f42073df86d1103888598a9042)
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98088
    Reviewed-by: Aron Budea <[email protected]>

diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js
index c7b604083..29bb77e67 100644
--- a/loleaflet/src/map/Clipboard.js
+++ b/loleaflet/src/map/Clipboard.js
@@ -139,6 +139,16 @@ L.Clipboard = L.Class.extend({
                ));
        },
 
+       // put in the clipboard if copy is disabled
+       _getCopyDisabledHtml: function() {
+               var lang = 'en_US'; // FIXME: l10n
+               return this._substProductName(this._originWrapBody(
+                   '  <body lang="' + lang + '" dir="ltr">\n' +
+                   '    <p></p>\n' +
+                   '  </body>\n', true
+               ));
+       },
+
        _getMetaOrigin: function (html) {
                var match = '<meta name="origin" content="';
                var start = html.indexOf(match);
@@ -340,6 +350,9 @@ L.Clipboard = L.Class.extend({
                        return;
                }
 
+               if (this._map['wopi'].DisableCopy)
+                       return;
+
                // Do we have a remote Online we can suck rich data from ?
                if (meta !== '')
                {
@@ -427,6 +440,9 @@ L.Clipboard = L.Class.extend({
 
        _getHtmlForClipboard: function() {
                var text;
+               if (this._map['wopi'].DisableCopy)
+                       return this._getCopyDisabledHtml();
+
                if (this._selectionType === 'complex' ||
                    this._map._docLayer.hasGraphicSelection()) {
                        console.log('Copy/Cut with complex/graphical 
selection');
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to