summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej@ahunt.org>2015-11-12 13:50:52 +0100
committerAndrzej Hunt <andrzej@ahunt.org>2015-11-12 15:09:30 +0100
commitfbc3965dc117967d2b5f51aa3902823da7c69d12 (patch)
tree7c353937f30c1af0d206e356140eb6e0364b9df2
parentf9dfd0129ce0b0e21e3f57488ff513794dbbaae5 (diff)
lok: send list of commands instead of ClearStyles
We currently send just one command, but this could be expanded server side in future. Change-Id: Id8f14196158f3a7fe9c54595d094603efd5e2ce3
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx2
-rw-r--r--desktop/source/lib/init.cxx25
2 files changed, 22 insertions, 5 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 2351c7bff79b..21e177a490a6 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -192,7 +192,7 @@ void DesktopLOKTest::testGetStyles()
rPair.first != "NumberingStyles" &&
rPair.first != "CellStyles" &&
rPair.first != "ShapeStyles" &&
- rPair.first != "ClearStyle")
+ rPair.first != "Commands")
{
CPPUNIT_FAIL("Unknown style family: " + rPair.first);
}
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 4b7608281f73..048215e71b5b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1301,10 +1301,27 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
aValues.add_child(sStyleFam.toUtf8().getStr(), aChildren);
}
- boost::property_tree::ptree aChildClearFormat;
- OUString sClearFormat = SVX_RESSTR( RID_SVXSTR_CLEARFORM );
- aChildClearFormat.put("", sClearFormat.toUtf8());
- aValues.add_child("ClearStyle", aChildClearFormat);
+ {
+ boost::property_tree::ptree aCommandList;
+
+ {
+ boost::property_tree::ptree aChild;
+
+ OUString sClearFormat = SVX_RESSTR( RID_SVXSTR_CLEARFORM );
+
+ boost::property_tree::ptree aName;
+ aName.put("", sClearFormat.toUtf8());
+ aChild.push_back(std::make_pair("text", aName));
+
+ boost::property_tree::ptree aCommand;
+ aCommand.put("", ".uno:ResetAttributes");
+ aChild.push_back(std::make_pair("id", aCommand));
+
+ aCommandList.push_back(std::make_pair("", aChild));
+ }
+
+ aValues.add_child("Commands", aCommandList);
+ }
aTree.add_child("commandValues", aValues);
std::stringstream aStream;