summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@collabora.com>2014-03-28 17:29:37 +0530
committerMuthu Subramanian <sumuthu@collabora.com>2014-03-28 17:40:49 +0530
commit186b96dcfbd0ed87ef414246555e9f953927d692 (patch)
tree82d07db57657f3caad97d693b2aa46ad558c775f /sd
parentcfc76de83e3c0a56abd30a8f3bd7c69d3500d223 (diff)
Add unit test for text gradfill import.
Change-Id: I803238fd21d1c73aae8146966a5e62e62ad48c5c
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/n862510_4.pptxbin0 -> 32840 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx27
2 files changed, 27 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/n862510_4.pptx b/sd/qa/unit/data/pptx/n862510_4.pptx
new file mode 100644
index 000000000000..0a461eee60e5
--- /dev/null
+++ b/sd/qa/unit/data/pptx/n862510_4.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 81f6b8a47d3c..462e2ed656a2 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -66,6 +66,7 @@ public:
void testN862510_1();
void testN862510_2();
void testN862510_3();
+ void testN862510_4();
void testFdo71961();
CPPUNIT_TEST_SUITE(SdFiltersTest);
@@ -87,6 +88,7 @@ public:
CPPUNIT_TEST(testN862510_1);
CPPUNIT_TEST(testN862510_2);
CPPUNIT_TEST(testN862510_3);
+ CPPUNIT_TEST(testN862510_4);
CPPUNIT_TEST(testFdo71961);
CPPUNIT_TEST_SUITE_END();
@@ -308,6 +310,31 @@ void SdFiltersTest::testN862510_3()
}
}
+void SdFiltersTest::testN862510_4()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/n862510_4.pptx") );
+ CPPUNIT_ASSERT_MESSAGE( "failed to load", xDocShRef.Is() );
+ CPPUNIT_ASSERT_MESSAGE( "in destruction", !xDocShRef->IsInDestruction() );
+
+ SdDrawDocument *pDoc = xDocShRef->GetDoc();
+ CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
+ const SdrPage *pPage = pDoc->GetPage( 1 );
+ CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
+ {
+ std::vector<EECharAttrib> rLst;
+ SdrObject *pObj = pPage->GetObj( 0 );
+ SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
+ CPPUNIT_ASSERT( pTxtObj );
+ const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
+ aEdit.GetCharAttribs( 0, rLst );
+ for( std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it != rLst.rend(); ++it )
+ {
+ const SvxColorItem *pC = dynamic_cast<const SvxColorItem *>( (*it).pAttr );
+ CPPUNIT_ASSERT_MESSAGE( "gradfill for text color not handled!", !( pC && pC->GetValue().GetColor() == 0 ) );
+ }
+ }
+}
+
void SdFiltersTest::testN828390()
{
bool bPassed = false;