summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-08-10 17:42:54 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-08-10 20:30:20 +0200
commite9bcd3475131b24b0b8818cfdfa256854ca5a59d (patch)
treeb7381ac319805bfa68a6394ea734fe27333077ad /libreofficekit
parent4d993ae8f267e35f7c030861a92226c940bb46cc (diff)
sw undo: add a Repair argument to the .uno:Undo/Redo commands
Undo/redo is limited to undo actions created by the same view in the LOK case, this argument removes this limit. This can be used by a client for "document repair" purposes, where undo/redo of others' changes is intentional. The sfx command dispatch has support for FASTCALL slots (a state function is not called, the command is always enabled) and also has support for state functions, but those functions only get the ID of the slots, not its parameters. What is needed here is a command that's disabled by default, but in case a Repair argument is used, then it's unconditionally enabled. So handle that case in the sfx dispatcher directly for now. Change-Id: I96c1130bf51abcdd722684b1fa4a8277f92fd555
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 6c8e2d54dd50..a53bd00c5d7c 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -535,6 +535,11 @@ static void documentRepair(GtkWidget* pButton, gpointer /*pItem*/)
boost::property_tree::ptree aTree;
aTree.put(boost::property_tree::ptree::path_type(aKey + "/type", '/'), "unsigned short");
aTree.put(boost::property_tree::ptree::path_type(aKey + "/value", '/'), nIndex + 1);
+
+ // Without this, we could only undo our own commands.
+ aTree.put(boost::property_tree::ptree::path_type("Repair/type", '/'), "boolean");
+ aTree.put(boost::property_tree::ptree::path_type("Repair/value", '/'), true);
+
std::stringstream aStream;
boost::property_tree::write_json(aStream, aTree);
std::string aArguments = aStream.str();