[Libreoffice-commits] online.git: loleaflet/src wsd/DocumentBroker.cpp wsd/Storage.cpp wsd/Storage.hpp
Marco Cecchetti
marco.cecchetti at collabora.com
Tue Apr 24 16:16:23 UTC 2018
loleaflet/src/control/Control.Menubar.js | 5 ++++-
loleaflet/src/map/handler/Map.WOPI.js | 2 ++
wsd/DocumentBroker.cpp | 1 +
wsd/Storage.cpp | 4 +++-
wsd/Storage.hpp | 4 ++++
5 files changed, 14 insertions(+), 2 deletions(-)
New commits:
commit 6a0fcdf15faff87da3d5431316777a85f4b3773c
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Mon Apr 23 16:25:00 2018 +0200
wopi flag for hiding the change tracking controls from UI
Change-Id: I1b9aa4f8111d77ae12093022205fad1cbee850ac
Reviewed-on: https://gerrit.libreoffice.org/53335
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 81288d617..d6ec74ca8 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -40,7 +40,7 @@ L.Control.Menubar = L.Control.extend({
{type: 'separator'},
{uno: '.uno:SearchDialog'},
{type: 'separator'},
- {name: _UNO('.uno:ChangesMenu', 'text'), type: 'menu', menu: [
+ {name: _UNO('.uno:ChangesMenu', 'text'), id: 'changesmenu', type: 'menu', menu: [
{uno: '.uno:TrackChanges'},
{uno: '.uno:ShowTrackedChanges'},
{type: 'separator'},
@@ -811,6 +811,9 @@ L.Control.Menubar = L.Control.extend({
if (menu[i].id && menu[i].id.startsWith('fullscreen-presentation') && this._map['wopi'].HideExportOption)
continue;
+ if (menu[i].id === 'changesmenu' && this._map['wopi'].HideChangeTrackingControls)
+ continue;
+
// Keep track of all 'downloadas-' options and register them as
// export formats with docLayer which can then be publicly accessed unlike
// this Menubar control for which there doesn't seem to be any easy way
diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js
index ff08ba7c1..5842259aa 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -13,6 +13,7 @@ L.Map.WOPI = L.Handler.extend({
HidePrintOption: false,
HideSaveOption: false,
HideExportOption: false,
+ HideChangeTrackingControls: false,
DisablePrint: false,
DisableExport: false,
DisableCopy: false,
@@ -67,6 +68,7 @@ L.Map.WOPI = L.Handler.extend({
this.HidePrintOption = !!wopiInfo['HidePrintOption'];
this.HideSaveOption = !!wopiInfo['HideSaveOption'];
this.HideExportOption = !!wopiInfo['HideExportOption'];
+ this.HideChangeTrackingControls = !!wopiInfo['HideChangeTrackingControls'];
this.DisablePrint = !!wopiInfo['DisablePrint'];
this.DisableExport = !!wopiInfo['DisableExport'];
this.DisableCopy = !!wopiInfo['DisableCopy'];
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 25a495e27..e972459af 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -502,6 +502,7 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const s
wopiInfo->set("HidePrintOption", wopifileinfo->_hidePrintOption);
wopiInfo->set("HideSaveOption", wopifileinfo->_hideSaveOption);
wopiInfo->set("HideExportOption", wopifileinfo->_hideExportOption);
+ wopiInfo->set("HideChangeTrackingControls", wopifileinfo->_hideChangeTrackingControls);
wopiInfo->set("DisablePrint", wopifileinfo->_disablePrint);
wopiInfo->set("DisableExport", wopifileinfo->_disableExport);
wopiInfo->set("DisableCopy", wopifileinfo->_disableCopy);
diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index f25220894..ca306a340 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -446,6 +446,7 @@ std::unique_ptr<WopiStorage::WOPIFileInfo> WopiStorage::getWOPIFileInfo(const Au
bool hidePrintOption = false;
bool hideSaveOption = false;
bool hideExportOption = false;
+ bool hideChangeTrackingControls = false;
bool disablePrint = false;
bool disableExport = false;
bool disableCopy = false;
@@ -469,6 +470,7 @@ std::unique_ptr<WopiStorage::WOPIFileInfo> WopiStorage::getWOPIFileInfo(const Au
JsonUtil::findJSONValue(object, "HidePrintOption", hidePrintOption);
JsonUtil::findJSONValue(object, "HideSaveOption", hideSaveOption);
JsonUtil::findJSONValue(object, "HideExportOption", hideExportOption);
+ JsonUtil::findJSONValue(object, "hideChangeTrackingControls", hideChangeTrackingControls);
JsonUtil::findJSONValue(object, "EnableOwnerTermination", enableOwnerTermination);
JsonUtil::findJSONValue(object, "DisablePrint", disablePrint);
JsonUtil::findJSONValue(object, "DisableExport", disableExport);
@@ -486,7 +488,7 @@ std::unique_ptr<WopiStorage::WOPIFileInfo> WopiStorage::getWOPIFileInfo(const Au
const Poco::Timestamp modifiedTime = iso8601ToTimestamp(lastModifiedTime, "LastModifiedTime");
_fileInfo = FileInfo({filename, ownerId, modifiedTime, size});
- return std::unique_ptr<WopiStorage::WOPIFileInfo>(new WOPIFileInfo({userId, userName, userExtraInfo, watermarkText, canWrite, postMessageOrigin, hidePrintOption, hideSaveOption, hideExportOption, enableOwnerTermination, disablePrint, disableExport, disableCopy, disableInactiveMessages, userCanNotWriteRelative, callDuration}));
+ return std::unique_ptr<WopiStorage::WOPIFileInfo>(new WOPIFileInfo({userId, userName, userExtraInfo, watermarkText, canWrite, postMessageOrigin, hidePrintOption, hideSaveOption, hideExportOption, hideChangeTrackingControls, enableOwnerTermination, disablePrint, disableExport, disableCopy, disableInactiveMessages, userCanNotWriteRelative, callDuration}));
}
/// uri format: http://server/<...>/wopi*/files/<id>/content
diff --git a/wsd/Storage.hpp b/wsd/Storage.hpp
index e55e3047f..1d96afd36 100644
--- a/wsd/Storage.hpp
+++ b/wsd/Storage.hpp
@@ -268,6 +268,7 @@ public:
const bool hidePrintOption,
const bool hideSaveOption,
const bool hideExportOption,
+ const bool hideChangeTrackingControls,
const bool enableOwnerTermination,
const bool disablePrint,
const bool disableExport,
@@ -283,6 +284,7 @@ public:
_hidePrintOption(hidePrintOption),
_hideSaveOption(hideSaveOption),
_hideExportOption(hideExportOption),
+ _hideChangeTrackingControls(hideChangeTrackingControls),
_enableOwnerTermination(enableOwnerTermination),
_disablePrint(disablePrint),
_disableExport(disableExport),
@@ -312,6 +314,8 @@ public:
bool _hideSaveOption;
/// Hide 'Download as' button/menubar item from UI
bool _hideExportOption;
+ /// Hide change tacking menu from UI
+ bool _hideChangeTrackingControls;
/// If WOPI host has enabled owner termination feature on
bool _enableOwnerTermination;
/// If WOPI host has allowed the user to print the document
More information about the Libreoffice-commits
mailing list