diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-03-17 08:17:53 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-03-30 04:34:16 +0200 |
commit | 0b1c4b8a0a5fb0b61cf044a2d54ba797fec69d9b (patch) | |
tree | 7ac92cc5678d39d60921781cf135ef83d69d97a5 /sc/qa | |
parent | c75c0cd7eea3b6c626ab3c981b717a92cbf1d8f8 (diff) |
add test for XPropertySet for ScCondFormatObj
Change-Id: I1786a8b1bf871ccefd73efe3e0515bc3a7dda709
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/extras/new_cond_format.cxx | 30 | ||||
-rw-r--r-- | sc/qa/extras/testdocuments/new_cond_format_api.ods | bin | 7376 -> 7843 bytes |
2 files changed, 29 insertions, 1 deletions
diff --git a/sc/qa/extras/new_cond_format.cxx b/sc/qa/extras/new_cond_format.cxx index ea17e10e646d..88bccdd71cd5 100644 --- a/sc/qa/extras/new_cond_format.cxx +++ b/sc/qa/extras/new_cond_format.cxx @@ -20,7 +20,7 @@ using namespace css; namespace sc_apitest { -#define NUMBER_OF_TESTS 2 +#define NUMBER_OF_TESTS 4 class ScConditionalFormatTest : public CalcUnoApiTest { @@ -34,11 +34,13 @@ public: void testRequestCondFormatListFromSheet(); void testCondFormatListProperties(); void testCondFormatListFormats(); + void testCondFormatProperties(); CPPUNIT_TEST_SUITE(ScConditionalFormatTest); CPPUNIT_TEST(testRequestCondFormatListFromSheet); CPPUNIT_TEST(testCondFormatListProperties); CPPUNIT_TEST(testCondFormatListFormats); + CPPUNIT_TEST(testCondFormatProperties); CPPUNIT_TEST_SUITE_END(); private: @@ -120,6 +122,32 @@ void ScConditionalFormatTest::testCondFormatListFormats() } } +void ScConditionalFormatTest::testCondFormatProperties() +{ + uno::Reference<sheet::XConditionalFormats> xCondFormatList = + getConditionalFormatList(init(1)); + + uno::Sequence<uno::Reference<sheet::XConditionalFormat> > xCondFormats = + xCondFormatList->getConditionalFormats(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xCondFormats.getLength()); + + uno::Reference<sheet::XConditionalFormat> xCondFormat = xCondFormats[0]; + CPPUNIT_ASSERT(xCondFormat.is()); + uno::Reference<beans::XPropertySet> xPropSet(xCondFormat, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("Range"); + uno::Reference<sheet::XSheetCellRanges> xCellRanges; + CPPUNIT_ASSERT(aAny >>= xCellRanges); + CPPUNIT_ASSERT(xCellRanges.is()); + uno::Sequence<table::CellRangeAddress> aRanges = xCellRanges->getRangeAddresses(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aRanges.getLength()); + table::CellRangeAddress aRange = aRanges[0]; + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), aRange.Sheet); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), aRange.StartColumn); + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), aRange.StartRow); + CPPUNIT_ASSERT_EQUAL(sal_Int32(7), aRange.EndColumn); + CPPUNIT_ASSERT_EQUAL(sal_Int32(16), aRange.EndRow); +} + void ScConditionalFormatTest::setUp() { nTest++; diff --git a/sc/qa/extras/testdocuments/new_cond_format_api.ods b/sc/qa/extras/testdocuments/new_cond_format_api.ods Binary files differindex 8208fea80ff1..3660f454c2c0 100644 --- a/sc/qa/extras/testdocuments/new_cond_format_api.ods +++ b/sc/qa/extras/testdocuments/new_cond_format_api.ods |