diff options
-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(); |