diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-05-13 08:26:32 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-05-16 11:59:46 +0200 |
commit | 49c87cd2c82f0203593487e579e84283ffb9f1fd (patch) | |
tree | 5e99f58e34307f514a06083f90721d26c8a9ee1b /tools/qa | |
parent | ebd760cffb9bf607b58f1eead796830a89e3cbba (diff) |
sw content controls, dropdown: add LOK API
- expose the available list items in a new "items" key of the
LOK_CALLBACK_CONTENT_CONTROL callback
- add a new lok::Document::sendContentControlEvent() function to be able
to select a list item from the current drop-down
- add a new listbox to the gtktiledviewer toolbar to select a content
control list item when the cursor is inside a dropdown
- add tests for the array API of tools::JsonWriter
(cherry picked from commit c7d80d229a5660a0ee702477bfbd2ca137992a7d)
Change-Id: I47f1333a7815d67952f7c20a9cba1b248886f6dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134385
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'tools/qa')
-rw-r--r-- | tools/qa/cppunit/test_json_writer.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/qa/cppunit/test_json_writer.cxx b/tools/qa/cppunit/test_json_writer.cxx index fe3019e91b0a..431c4fdeebe2 100644 --- a/tools/qa/cppunit/test_json_writer.cxx +++ b/tools/qa/cppunit/test_json_writer.cxx @@ -32,10 +32,12 @@ public: void test1(); void test2(); + void testArray(); CPPUNIT_TEST_SUITE(JsonWriterTest); CPPUNIT_TEST(test1); CPPUNIT_TEST(test2); + CPPUNIT_TEST(testArray); CPPUNIT_TEST_SUITE_END(); }; @@ -84,6 +86,21 @@ void JsonWriterTest::test2() std::string(result.get())); } +void JsonWriterTest::testArray() +{ + tools::JsonWriter aJson; + { + tools::ScopedJsonWriterArray aArray = aJson.startArray("items"); + aJson.putSimpleValue("foo"); + aJson.putSimpleValue("bar"); + } + + std::unique_ptr<char, o3tl::free_delete> aResult(aJson.extractData()); + + CPPUNIT_ASSERT_EQUAL(std::string("{ \"items\": [ \"foo\", \"bar\"]}"), + std::string(aResult.get())); +} + CPPUNIT_TEST_SUITE_REGISTRATION(JsonWriterTest); } |