Kaydet (Commit) 5681725f authored tarafından Matúš Kukan's avatar Matúš Kukan

bnc#480256: OOXML import: unit test for table background property

Change-Id: I97bf0bd1ea8cf8ece30a2fa328c5c7a8b0549a4a
üst 7ad83656
...@@ -76,6 +76,7 @@ public: ...@@ -76,6 +76,7 @@ public:
void testN862510_4(); void testN862510_4();
void testBnc870237(); void testBnc870237();
void testBnc887225(); void testBnc887225();
void testBnc480256();
void testCreationDate(); void testCreationDate();
CPPUNIT_TEST_SUITE(SdFiltersTest); CPPUNIT_TEST_SUITE(SdFiltersTest);
...@@ -97,6 +98,7 @@ public: ...@@ -97,6 +98,7 @@ public:
CPPUNIT_TEST(testN862510_4); CPPUNIT_TEST(testN862510_4);
CPPUNIT_TEST(testBnc870237); CPPUNIT_TEST(testBnc870237);
CPPUNIT_TEST(testBnc887225); CPPUNIT_TEST(testBnc887225);
CPPUNIT_TEST(testBnc480256);
CPPUNIT_TEST(testCreationDate); CPPUNIT_TEST(testCreationDate);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
...@@ -661,6 +663,52 @@ void SdFiltersTest::testBnc887225() ...@@ -661,6 +663,52 @@ void SdFiltersTest::testBnc887225()
xDocShRef->DoClose(); xDocShRef->DoClose();
} }
void SdFiltersTest::testBnc480256()
{
::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc480256.pptx"), PPTX);
// In the document, there are two tables with table background properties.
// Make sure colors are set properly for individual cells.
// TODO: If you are working on improving table background support, expect
// this unit test to fail. In that case, feel free to change the numbers.
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;
uno::Reference< table::XCellRange > xTable;
uno::Reference< beans::XPropertySet > xCell;
sal_Int32 nColor;
pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
CPPUNIT_ASSERT( pTableObj );
xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
CPPUNIT_ASSERT_EQUAL(sal_Int32(10208238), nColor);
xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
CPPUNIT_ASSERT_EQUAL(sal_Int32(13032959), nColor);
pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(1));
CPPUNIT_ASSERT( pTableObj );
xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
CPPUNIT_ASSERT_EQUAL(sal_Int32(7056614), nColor);
xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nColor;
CPPUNIT_ASSERT_EQUAL(sal_Int32(4626400), nColor);
xDocShRef->DoClose();
}
CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest); CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment