summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-03-17 08:28:20 +0100
committerJan Holesovsky <kendy@collabora.com>2015-04-09 11:39:23 +0200
commit8378ea85b52993ffc6faae0e94223c41a5a16795 (patch)
tree5045788b16ed74584620794eed5eda3d643fb601
parentadd test for XPropertySet for ScCondFormatObj (diff)
downloadcore-8378ea85b52993ffc6faae0e94223c41a5a16795.tar.gz
core-8378ea85b52993ffc6faae0e94223c41a5a16795.zip
add XIndex interface tests for ScCondFormatObj
Change-Id: I55604485183057f476c636abc4d43bc9fc58711a
-rw-r--r--sc/qa/extras/new_cond_format.cxx28
1 files changed, 27 insertions, 1 deletions
diff --git a/sc/qa/extras/new_cond_format.cxx b/sc/qa/extras/new_cond_format.cxx
index 88bccdd71cd5..e648edcfe0ae 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 4
+#define NUMBER_OF_TESTS 5
class ScConditionalFormatTest : public CalcUnoApiTest
{
@@ -35,12 +35,14 @@ public:
void testCondFormatListProperties();
void testCondFormatListFormats();
void testCondFormatProperties();
+ void testCondFormatXIndex();
CPPUNIT_TEST_SUITE(ScConditionalFormatTest);
CPPUNIT_TEST(testRequestCondFormatListFromSheet);
CPPUNIT_TEST(testCondFormatListProperties);
CPPUNIT_TEST(testCondFormatListFormats);
CPPUNIT_TEST(testCondFormatProperties);
+ CPPUNIT_TEST(testCondFormatXIndex);
CPPUNIT_TEST_SUITE_END();
private:
@@ -148,6 +150,30 @@ void ScConditionalFormatTest::testCondFormatProperties()
CPPUNIT_ASSERT_EQUAL(sal_Int32(16), aRange.EndRow);
}
+void ScConditionalFormatTest::testCondFormatXIndex()
+{
+ 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::Type aType = xCondFormat->getElementType();
+ CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.sheet.XConditionEntry"), aType.getTypeName());
+
+ CPPUNIT_ASSERT(xCondFormat->hasElements());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xCondFormat->getCount());
+ /*
+ * missing implementation
+ uno::Any aAny = xCondFormat->getByIndex(0);
+ CPPUNIT_ASSERT(aAny.hasValue());
+ */
+}
+
void ScConditionalFormatTest::setUp()
{
nTest++;