diff options
Diffstat (limited to 'sd/qa/unit/import-tests.cxx')
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index ede33d6fda7c..b92b475d2088 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -92,6 +92,7 @@ public: void testCreationDate(); void testBnc584721_4(); void testFdo79731(); + void testBnc904423(); CPPUNIT_TEST_SUITE(SdFiltersTest); CPPUNIT_TEST(testDocumentLayout); @@ -125,6 +126,7 @@ public: CPPUNIT_TEST(testCreationDate); CPPUNIT_TEST(testBnc584721_4); CPPUNIT_TEST(testFdo79731); + CPPUNIT_TEST(testBnc904423); CPPUNIT_TEST_SUITE_END(); }; @@ -1116,6 +1118,58 @@ void SdFiltersTest::testFdo79731() xDocShRef->DoClose(); } +void SdFiltersTest::testBnc904423() +{ + // Here the problem was that different fill properties were applied in wrong order on the shape + // Right order: 1) master slide fill style, 2) theme, 3) direct formatting + ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("sd/qa/unit/data/pptx/bnc904423.pptx")); + + SdDrawDocument *pDoc = xDocShRef->GetDoc(); + CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL ); + const SdrPage *pPage = pDoc->GetPage(1); + CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL ); + + // First shape's background color is defined on master slide + { + SdrObject *const pObj = pPage->GetObj(0); + CPPUNIT_ASSERT(pObj); + + const XFillStyleItem& rStyleItem = dynamic_cast<const XFillStyleItem&>( + pObj->GetMergedItem(XATTR_FILLSTYLE)); + CPPUNIT_ASSERT_EQUAL(XFILL_SOLID, rStyleItem.GetValue()); + const XFillColorItem& rColorItem = dynamic_cast<const XFillColorItem&>( + pObj->GetMergedItem(XATTR_FILLCOLOR)); + CPPUNIT_ASSERT_EQUAL(ColorData(0x00CC99), rColorItem.GetColorValue().GetColor()); + } + + // Second shape's background color is defined by theme + { + SdrObject *const pObj = pPage->GetObj(1); + CPPUNIT_ASSERT(pObj); + + const XFillStyleItem& rStyleItem = dynamic_cast<const XFillStyleItem&>( + pObj->GetMergedItem(XATTR_FILLSTYLE)); + CPPUNIT_ASSERT_EQUAL(XFILL_SOLID, rStyleItem.GetValue()); + const XFillColorItem& rColorItem = dynamic_cast<const XFillColorItem&>( + pObj->GetMergedItem(XATTR_FILLCOLOR)); + CPPUNIT_ASSERT_EQUAL(ColorData(0x3333CC), rColorItem.GetColorValue().GetColor()); + } + + // Third shape's background color is defined by direct formatting + { + SdrObject *const pObj = pPage->GetObj(2); + CPPUNIT_ASSERT(pObj); + + const XFillStyleItem& rStyleItem = dynamic_cast<const XFillStyleItem&>( + pObj->GetMergedItem(XATTR_FILLSTYLE)); + CPPUNIT_ASSERT_EQUAL(XFILL_SOLID, rStyleItem.GetValue()); + const XFillColorItem& rColorItem = dynamic_cast<const XFillColorItem&>( + pObj->GetMergedItem(XATTR_FILLCOLOR)); + CPPUNIT_ASSERT_EQUAL(ColorData(0xFF0000), rColorItem.GetColorValue().GetColor()); + } + + xDocShRef->DoClose(); +} CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest); |