diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-07-15 14:01:01 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-07-15 14:29:44 +0200 |
commit | 3d76a540f64f1f55f35863f18eed4b315e0d1e64 (patch) | |
tree | cf6db6bfc477c9ad131460c3f28c7f958aeaba1a /sd | |
parent | 5d2f12a44d2af3e42e0c3a17ff556f5ada27b1b8 (diff) |
Unit test for cell properties, where lastRow is used in table (bnc#887225)
Change-Id: Ia11dadcbedf6acc035b2d86da39a115bdb298591
Diffstat (limited to 'sd')
-rwxr-xr-x | sd/qa/unit/data/pptx/bnc887225.pptx | bin | 0 -> 32814 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 51 |
2 files changed, 51 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/bnc887225.pptx b/sd/qa/unit/data/pptx/bnc887225.pptx Binary files differnew file mode 100755 index 000000000000..e5c528f1809c --- /dev/null +++ b/sd/qa/unit/data/pptx/bnc887225.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 01aade4e7b0c..e8e148f85a0d 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -29,6 +29,7 @@ #include <svx/svdogrp.hxx> #include <svx/svdomedia.hxx> #include <svx/svdoole2.hxx> +#include <svx/svdotable.hxx> #include <svx/xflclit.hxx> #include <animations/animationnodehelper.hxx> @@ -69,6 +70,7 @@ public: void testN862510_2(); void testN862510_4(); void testBnc870237(); + void testBnc887225(); CPPUNIT_TEST_SUITE(SdFiltersTest); CPPUNIT_TEST(testDocumentLayout); @@ -87,6 +89,7 @@ public: CPPUNIT_TEST(testN862510_2); CPPUNIT_TEST(testN862510_4); CPPUNIT_TEST(testBnc870237); + CPPUNIT_TEST(testBnc887225); CPPUNIT_TEST_SUITE_END(); }; @@ -550,6 +553,54 @@ void SdFiltersTest::testBnc870237() xDocShRef->DoClose(); } +void SdFiltersTest::testBnc887225() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/bnc887225.pptx") ); + // In the document, lastRow and lastCol table properties are used. + // Make sure styles are set properly for individual cells. + + SdDrawDocument *pDoc = xDocShRef->GetDoc(); + CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL ); + const SdrPage *pPage = pDoc->GetPage(1); + CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL ); + + sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(2)); + CPPUNIT_ASSERT( pTableObj ); + uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW); + uno::Reference< beans::XPropertySet > xCell; + sal_Int32 nColor; + + xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW); + xCell->getPropertyValue("FillColor") >>= nColor; + CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor); + + xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW); + xCell->getPropertyValue("FillColor") >>= nColor; + CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor); + + xCell.set(xTable->getCellByPosition(1, 1), uno::UNO_QUERY_THROW); + xCell->getPropertyValue("FillColor") >>= nColor; + CPPUNIT_ASSERT_EQUAL(sal_Int32(13754095), nColor); + + xCell.set(xTable->getCellByPosition(1, 2), uno::UNO_QUERY_THROW); + xCell->getPropertyValue("FillColor") >>= nColor; + CPPUNIT_ASSERT_EQUAL(sal_Int32(15331319), nColor); + + xCell.set(xTable->getCellByPosition(1, 4), uno::UNO_QUERY_THROW); + xCell->getPropertyValue("FillColor") >>= nColor; + CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor); + + xCell.set(xTable->getCellByPosition(3, 2), uno::UNO_QUERY_THROW); + xCell->getPropertyValue("FillColor") >>= nColor; + CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor); + + xCell.set(xTable->getCellByPosition(3, 4), uno::UNO_QUERY_THROW); + xCell->getPropertyValue("FillColor") >>= nColor; + CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest); CPPUNIT_PLUGIN_IMPLEMENT(); |