summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-05-19 11:45:04 +0200
committerAndras Timar <andras.timar@collabora.com>2020-07-01 17:49:54 +0200
commit59d121bd26ce0a03fc5ec962faee65ec85f2d0ed (patch)
tree11db528079859f18a58efa66f02fbfc1d1f7359d
parentMake sure document title bar is not above dialogs (diff)
downloadonline-59d121bd26ce0a03fc5ec962faee65ec85f2d0ed.tar.gz
online-59d121bd26ce0a03fc5ec962faee65ec85f2d0ed.zip
tdf#131123 Report back save result
Change-Id: Ie3dee5d344bc65c325b95f2746c9734bdd9e2f9d Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94490 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95704 Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--loleaflet/html/framed.doc.html2
-rw-r--r--loleaflet/src/core/Socket.js19
-rw-r--r--wsd/ClientSession.cpp13
3 files changed, 20 insertions, 14 deletions
diff --git a/loleaflet/html/framed.doc.html b/loleaflet/html/framed.doc.html
index 0b68c698dd..c58d306c9b 100644
--- a/loleaflet/html/framed.doc.html
+++ b/loleaflet/html/framed.doc.html
@@ -107,6 +107,8 @@
if (msg.Values) {
if (msg.Values.success == true) {
document.getElementById("ModifiedStatus").innerHTML = "Saved";
+ } else {
+ document.getElementById("ModifiedStatus").innerHTML = "Error during save";
}
}
}
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index a5e394c67c..9f48d31458 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -358,9 +358,16 @@ L.Socket = L.Class.extend({
}
else if (textMsg.startsWith('commandresult: ')) {
var commandresult = JSON.parse(textMsg.substring(textMsg.indexOf('{')));
- if (commandresult['command'] === 'savetostorage' && commandresult['success']) {
- // Close any open confirmation dialogs
- vex.closeAll();
+ if (commandresult['command'] === 'savetostorage' || commandresult['command'] === 'save') {
+ if (commandresult['success']) {
+ // Close any open confirmation dialogs
+ vex.closeAll();
+ }
+
+ var postMessageObj = {
+ success: commandresult['success']
+ };
+ this._map.fire('postMessage', {msgId: 'Action_Save_Resp', args: postMessageObj});
}
return;
}
@@ -744,12 +751,6 @@ L.Socket = L.Class.extend({
}
});
}
-
- // Issue the save response to be consistent with normal save.
- var postMessageObj = {
- success: true
- };
- this._map.fire('postMessage', {msgId: 'Action_Save_Resp', args: postMessageObj});
}
// var name = command.name; - ignored, we get the new name via the wopi's BaseFileName
}
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 20b1ed011b..3f37c88c4a 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -552,8 +552,11 @@ bool ClientSession::_handleInput(const char *buffer, int length)
constexpr bool isAutosave = false;
constexpr bool isExitSave = false;
- docBroker->sendUnoSave(getId(), dontTerminateEdit != 0, dontSaveIfUnmodified != 0,
+ bool result = docBroker->sendUnoSave(getId(), dontTerminateEdit != 0, dontSaveIfUnmodified != 0,
isAutosave, isExitSave, extendedData);
+ std::string resultstr = result ? "true" : "false";
+ std::string msg = "commandresult: { \"command\": \"save\", \"success\": " + resultstr + " }";
+ docBroker->broadcastMessage(msg);
}
}
else if (tokens.equals(0, "savetostorage"))
@@ -562,10 +565,10 @@ bool ClientSession::_handleInput(const char *buffer, int length)
if (tokens.size() > 1)
getTokenInteger(tokens[1], "force", force);
- if (docBroker->saveToStorage(getId(), true, "" /* This is irrelevant when success is true*/, true))
- {
- docBroker->broadcastMessage("commandresult: { \"command\": \"savetostorage\", \"success\": true }");
- }
+ bool result = docBroker->saveToStorage(getId(), true, "" /* This is irrelevant when success is true*/, true);
+ std::string resultstr = result ? "true" : "false";
+ std::string msg = "commandresult: { \"command\": \"savetostorage\", \"success\": " + resultstr + " }";
+ docBroker->broadcastMessage(msg);
}
else if (tokens.equals(0, "clientvisiblearea"))
{