[Libreoffice-commits] online.git: loleaflet/src wsd/ClientSession.cpp
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Sun Jul 12 17:11:25 UTC 2020
loleaflet/src/control/Toolbar.js | 9 ++++++++-
wsd/ClientSession.cpp | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
New commits:
commit 08d81615e7aac5107b6dc601bd43a15f92ead17f
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Jul 11 21:13:23 2020 +0200
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sun Jul 12 19:11:06 2020 +0200
add .uno:EditAnnotation as exception when in read-only mode
Change-Id: Ic6cd15973a96d20895a1e0dc47fc33692b09ec92
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98589
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 640fe00dc..c2cd5a837 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -157,7 +157,14 @@ L.Map.include({
},
sendUnoCommand: function (command, json) {
- var isAllowedInReadOnly = command == '.uno:WordCountDialog';
+ var isAllowedInReadOnly = false;
+ var allowedCommands = ['.uno:WordCountDialog', '.uno:EditAnnotation'];
+ for (var i in allowedCommands) {
+ if (allowedCommands[i] === command) {
+ isAllowedInReadOnly = true;
+ break;
+ }
+ }
if (this._permission === 'edit' || isAllowedInReadOnly) {
this._socket.sendMessage('uno ' + command + (json ? ' ' + JSON.stringify(json) : ''));
}
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index abed4c5df..76e93fa33 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -992,7 +992,7 @@ bool ClientSession::filterMessage(const std::string& message) const
}
else if (tokens.equals(0, "uno"))
{
- if (tokens.size() > 1 && tokens.equals(1, ".uno:ExecuteSearch"))
+ if (tokens.size() > 1 && (tokens.equals(1, ".uno:ExecuteSearch") || tokens.equals(1, ".uno:EditAnnotation")))
{
allowed = true;
}
More information about the Libreoffice-commits
mailing list