From 32f700a683b7faa17c58e6d1aad85915ebd40a1a Mon Sep 17 00:00:00 2001 From: Muthu Subramanian Date: Mon, 25 Nov 2013 19:39:20 +0530 Subject: fdo#68594: Adding unit test. --- sd/qa/unit/data/ppt/fdo68594.ppt | Bin 0 -> 100864 bytes sd/qa/unit/import-tests.cxx | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 sd/qa/unit/data/ppt/fdo68594.ppt (limited to 'sd') diff --git a/sd/qa/unit/data/ppt/fdo68594.ppt b/sd/qa/unit/data/ppt/fdo68594.ppt new file mode 100644 index 000000000000..83a95cd4d8ef Binary files /dev/null and b/sd/qa/unit/data/ppt/fdo68594.ppt differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 23ddec36fcc5..bd65a309f4a9 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include #include @@ -47,6 +49,7 @@ public: void testFdo64512(); void testFdo71075(); void testN828390(); + void testFdo68594(); CPPUNIT_TEST_SUITE(SdFiltersTest); CPPUNIT_TEST(testDocumentLayout); @@ -56,6 +59,7 @@ public: CPPUNIT_TEST(testFdo64512); CPPUNIT_TEST(testFdo71075); CPPUNIT_TEST(testN828390); + CPPUNIT_TEST(testFdo68594); CPPUNIT_TEST_SUITE_END(); }; @@ -240,6 +244,25 @@ void SdFiltersTest::testN778859() } } +void SdFiltersTest::testFdo68594() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/ppt/fdo68594.ppt")); + CPPUNIT_ASSERT_MESSAGE( "failed to load", xDocShRef.Is() ); + CPPUNIT_ASSERT_MESSAGE( "not in destruction", !xDocShRef->IsInDestruction() ); + + SdDrawDocument *pDoc = xDocShRef->GetDoc(); + CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL ); + const SdrPage *pPage = &(pDoc->GetPage (1)->TRG_GetMasterPage()); + CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL ); + SdrObject *pObj = pPage->GetObj(1); + SdrTextObj *pTxtObj = dynamic_cast( pObj ); + CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != NULL); + const SvxColorItem *pC = dynamic_cast(&pTxtObj->GetMergedItem(EE_CHAR_COLOR)); + CPPUNIT_ASSERT_MESSAGE( "no color item", pC != NULL); + // Color should be black + CPPUNIT_ASSERT_MESSAGE( "Placeholder color mismatch", pC->GetValue().GetColor() == 0); +} + void SdFiltersTest::testFdo64512() { ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/fdo64512.odp")); -- cgit