summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorMihai Varga <mihai.varga@collabora.com>2015-09-04 10:27:58 +0300
committerMihai Varga <mihai.varga@collabora.com>2015-09-04 12:22:28 +0300
commit9640dcea46dd3201aa4c27f6a3918f7419288a2a (patch)
tree6752a61fb2e4311d9aecb6086de83f345beb5e41 /libreofficekit
parent51ac2bf234a98d8f7629132b59f6961597ecea14 (diff)
LOK: added a general getCommandValues method
This method returns a JSON mapping of the posible values for the given command (e.g. .uno:StyleApply, etc). returns: {commandName: "cmdName", commandValues: {json_of_cmd_values}} Change-Id: Ic8f970d077af6be9bc226f72f725b6cdf2d4c160
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/unit/tiledrendering.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx
index a4e552507c39..a2cbe6ecc0bc 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -195,12 +195,16 @@ void TiledRenderingTest::testGetStyles( Office* pOffice )
scoped_ptr< Document> pDocument( pOffice->documentLoad( sDocPath.c_str() ) );
boost::property_tree::ptree aTree;
- char* pJSON = pDocument->getStyles();
+ char* pJSON = pDocument->getCommandValues(".uno:StyleApply");
std::stringstream aStream(pJSON);
boost::property_tree::read_json(aStream, aTree);
CPPUNIT_ASSERT( aTree.size() > 0 );
+ CPPUNIT_ASSERT( aTree.get_value<std::string>("commandName") == ".uno:StyleApply" );
- for (const std::pair<std::string, boost::property_tree::ptree>& rPair : aTree)
+
+ boost::property_tree::ptree aValues = aTree.get_child("commandValues");
+ CPPUNIT_ASSERT( aValues.size() > 0 );
+ for (const std::pair<std::string, boost::property_tree::ptree>& rPair : aValues)
{
CPPUNIT_ASSERT( rPair.second.size() > 0);
if (rPair.first != "CharacterStyles" &&