diff options
author | Mihai Varga <mihai.varga@collabora.com> | 2015-09-10 09:21:45 +0300 |
---|---|---|
committer | Mihai Varga <mihai.mv13@gmail.com> | 2015-09-10 11:34:20 +0300 |
commit | 39975c477a38be613e9e162acb6de241999f0ae1 (patch) | |
tree | a7f0cddb5b73252476254a8a6252ba0d5b3718ad /desktop/qa | |
parent | 76eff026062c2bb755256cf9b335711d5421d27f (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}}
I've fixed the unit test this time
Change-Id: I30b0fba8ba1db33dd79f4b46026d293b9ea72402
Diffstat (limited to 'desktop/qa')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index c88a53f41edb..842d209f8fb3 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -87,12 +87,15 @@ void DesktopLOKTest::testGetStyles() { LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); boost::property_tree::ptree aTree; - char* pJSON = pDocument->m_pDocumentClass->getStyles(pDocument); + char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:StyleApply"); std::stringstream aStream(pJSON); boost::property_tree::read_json(aStream, aTree); CPPUNIT_ASSERT( aTree.size() > 0 ); + CPPUNIT_ASSERT( aTree.get_child("commandName").get_value<std::string>() == ".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" && |