From e9bcd3475131b24b0b8818cfdfa256854ca5a59d Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 10 Aug 2016 17:42:54 +0200 Subject: 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 --- libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libreofficekit') 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(); -- cgit