loleaflet/src/control/Toolbar.js      |    9 ++++++++-
 loleaflet/src/map/handler/Map.WOPI.js |    6 ++++++
 wsd/DocumentBroker.cpp                |    3 +++
 3 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit a76825728e13a36ed570621cfb9da72b5e3c0a24
Author: Pranav Kant <[email protected]>
Date:   Tue Dec 13 17:54:42 2016 +0530

    Pass Disable{Print,Export,Copy} options to client and handle them
    
    Change-Id: I59a9432bbdd06d8b184f96882c5f4009fcd0be54

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 5fe402f..8ad990a 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -52,13 +52,20 @@ L.Map.include({
                        return;
                }
 
+               id = id || 'export'; // not any special download, simple export
+
+               if ((id === 'print' && this['wopi'].DisablePrint) ||
+                   (id === 'export' && this['wopi'].DisableExport)) {
+                       this.hideBusy();
+                       return;
+               }
+
                if (format === undefined || format === null) {
                        format = '';
                }
                if (options === undefined || options === null) {
                        options = '';
                }
-               id = id || 'export'; // not any special download, simple export
 
                this.showBusy(_('Downloading...'), false);
                this._socket.sendMessage('downloadas ' +
diff --git a/loleaflet/src/map/handler/Map.WOPI.js 
b/loleaflet/src/map/handler/Map.WOPI.js
index a47fc09..38e0a5b 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -10,6 +10,9 @@ L.Map.WOPI = L.Handler.extend({
        HidePrintOption: false,
        HideSaveOption: false,
        HideExportOption: false,
+       DisablePrint: false,
+       DisableExport: false,
+       DisableCopy: false,
 
        _appLoadedConditions: {
                doclayerinit: false,
@@ -57,6 +60,9 @@ L.Map.WOPI = L.Handler.extend({
                this.HidePrintOption = !!wopiInfo['HidePrintOption'];
                this.HideSaveOption = !!wopiInfo['HideSaveOption'];
                this.HideExportOption = !!wopiInfo['HideExportOption'];
+               this.DisablePrint = !!wopiInfo['DisablePrint'];
+               this.DisableExport = !!wopiInfo['DisableExport'];
+               this.DisableCopy = !!wopiInfo['DisableCopy'];
 
                this._map.fire('postMessage', {msgId: 'App_LoadingStatus', 
args: {Status: 'Frame_Ready'}});
        },
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 319b3e8..4a5b1c8 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -269,6 +269,9 @@ bool DocumentBroker::load(std::shared_ptr<ClientSession>& 
session, const std::st
         wopiInfo->set("HidePrintOption", wopifileinfo->_hidePrintOption);
         wopiInfo->set("HideSaveOption", wopifileinfo->_hideSaveOption);
         wopiInfo->set("HideExportOption", wopifileinfo->_hideExportOption);
+        wopiInfo->set("DisablePrint", wopifileinfo->_disablePrint);
+        wopiInfo->set("DisableExport", wopifileinfo->_disableExport);
+        wopiInfo->set("DisableCopy", wopifileinfo->_disableCopy);
 
         std::ostringstream ossWopiInfo;
         wopiInfo->stringify(ossWopiInfo);
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to