diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-05-13 08:26:32 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-05-13 09:10:25 +0200 |
commit | c7d80d229a5660a0ee702477bfbd2ca137992a7d (patch) | |
tree | 841439801c80dab822561b224b162f86c748f4e5 /tools | |
parent | 09e0cfd9b3e391435c39d3bc933d26a87e2b082e (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
Change-Id: I47f1333a7815d67952f7c20a9cba1b248886f6dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134256
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'tools')
-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 2257fe6d834d..188b22f9c617 100644 --- a/tools/qa/cppunit/test_json_writer.cxx +++ b/tools/qa/cppunit/test_json_writer.cxx @@ -29,10 +29,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(); }; @@ -81,6 +83,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); } |