From b234743dd26e0be4be272d2d2c82f90c67e192b7 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Mon, 18 Nov 2019 22:50:46 +0100 Subject: widget theme: add centeredTabs setting to theme definition file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I714a44d40a99e0bb5ff48e3d36ded73db60af5a0 Reviewed-on: https://gerrit.libreoffice.org/83133 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- .../widgetdraw/WidgetDefinitionReaderTest.cxx | 28 +++++++++++++++++++++- .../widgetdraw/data/definitionSettings1.xml | 5 ++++ .../widgetdraw/data/definitionSettings2.xml | 6 +++++ .../widgetdraw/data/definitionSettings3.xml | 6 +++++ 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 vcl/qa/cppunit/widgetdraw/data/definitionSettings1.xml create mode 100644 vcl/qa/cppunit/widgetdraw/data/definitionSettings2.xml create mode 100644 vcl/qa/cppunit/widgetdraw/data/definitionSettings3.xml (limited to 'vcl/qa') diff --git a/vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx b/vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx index 9cf818932c38..cd7945fba82c 100644 --- a/vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx +++ b/vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx @@ -28,18 +28,44 @@ private: public: void testRead(); + void testReadSettings(); CPPUNIT_TEST_SUITE(WidgetDefinitionReaderTest); CPPUNIT_TEST(testRead); + CPPUNIT_TEST(testReadSettings); CPPUNIT_TEST_SUITE_END(); }; +void WidgetDefinitionReaderTest::testReadSettings() +{ + { + vcl::WidgetDefinition aDefinition; + vcl::WidgetDefinitionReader aReader(getFullUrl("definitionSettings1.xml"), getFullUrl("")); + CPPUNIT_ASSERT(aReader.read(aDefinition)); + CPPUNIT_ASSERT_EQUAL(OString(""), aDefinition.mpSettings->msCenteredTabs); + } + + { + vcl::WidgetDefinition aDefinition; + vcl::WidgetDefinitionReader aReader(getFullUrl("definitionSettings2.xml"), getFullUrl("")); + CPPUNIT_ASSERT(aReader.read(aDefinition)); + CPPUNIT_ASSERT_EQUAL(OString("true"), aDefinition.mpSettings->msCenteredTabs); + } + + { + vcl::WidgetDefinition aDefinition; + vcl::WidgetDefinitionReader aReader(getFullUrl("definitionSettings3.xml"), getFullUrl("")); + CPPUNIT_ASSERT(aReader.read(aDefinition)); + CPPUNIT_ASSERT_EQUAL(OString("false"), aDefinition.mpSettings->msCenteredTabs); + } +} + void WidgetDefinitionReaderTest::testRead() { vcl::WidgetDefinition aDefinition; vcl::WidgetDefinitionReader aReader(getFullUrl("definition1.xml"), getFullUrl("")); - aReader.read(aDefinition); + CPPUNIT_ASSERT(aReader.read(aDefinition)); CPPUNIT_ASSERT_EQUAL(OUString("123456"), aDefinition.mpStyle->maFaceColor.AsRGBHexString()); CPPUNIT_ASSERT_EQUAL(OUString("234567"), aDefinition.mpStyle->maCheckedColor.AsRGBHexString()); diff --git a/vcl/qa/cppunit/widgetdraw/data/definitionSettings1.xml b/vcl/qa/cppunit/widgetdraw/data/definitionSettings1.xml new file mode 100644 index 000000000000..9ca7f894f29d --- /dev/null +++ b/vcl/qa/cppunit/widgetdraw/data/definitionSettings1.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/vcl/qa/cppunit/widgetdraw/data/definitionSettings2.xml b/vcl/qa/cppunit/widgetdraw/data/definitionSettings2.xml new file mode 100644 index 000000000000..0d6d6e11151a --- /dev/null +++ b/vcl/qa/cppunit/widgetdraw/data/definitionSettings2.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/vcl/qa/cppunit/widgetdraw/data/definitionSettings3.xml b/vcl/qa/cppunit/widgetdraw/data/definitionSettings3.xml new file mode 100644 index 000000000000..20541b2a219e --- /dev/null +++ b/vcl/qa/cppunit/widgetdraw/data/definitionSettings3.xml @@ -0,0 +1,6 @@ + + + + + + -- cgit