diff options
author | PriyankaGaikwad <priyanka.gaikwad@synerzip.com> | 2015-03-23 18:14:28 +0530 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2015-03-24 15:45:08 +0000 |
commit | 8707670cb39f5777cd54f8b180ec342416ef259f (patch) | |
tree | 2676713016b6102f477b298c4d76a1fe6b553862 /sd | |
parent | 849c1b64de19ef42cbd8cd392b036b9f914f2522 (diff) |
tdf#90174 FILESAVE: export of bullet color for pptx
Added pptx export support for bullet color.
Change-Id: I69306c8b3ace359f8dc243b83f89cfb570b9b73b
Reviewed-on: https://gerrit.libreoffice.org/14966
Tested-by: David Tardon <dtardon@redhat.com>
Reviewed-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/bulletColor.pptx | bin | 0 -> 32946 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 28 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/bulletColor.pptx b/sd/qa/unit/data/pptx/bulletColor.pptx Binary files differnew file mode 100644 index 000000000000..61bb834e4a6c --- /dev/null +++ b/sd/qa/unit/data/pptx/bulletColor.pptx diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index d6645dd809e1..938615901b1d 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -84,6 +84,7 @@ public: void testLinkedGraphicRT(); void testImageWithSpecialID(); void testTableCellFillProperties(); + void testBulletColor(); #if !defined WNT void testBnc822341(); #endif @@ -107,6 +108,7 @@ public: CPPUNIT_TEST(testLinkedGraphicRT); CPPUNIT_TEST(testImageWithSpecialID); CPPUNIT_TEST(testTableCellFillProperties); + CPPUNIT_TEST(testBulletColor); #if !defined WNT CPPUNIT_TEST(testBnc822341); #endif @@ -820,6 +822,32 @@ void SdExportTest::testBnc822341() #endif +void SdExportTest::testBulletColor() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/bulletColor.pptx"), PPTX ); + + xDocShRef = saveAndReload( xDocShRef, PPTX ); + + uno::Reference< drawing::XDrawPagesSupplier > xDoc( + xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW ); + + uno::Reference< drawing::XDrawPage > xPage( + xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW ); + SdDrawDocument *pDoc = xDocShRef->GetDoc(); + CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL ); + + const SdrPage *pPage = pDoc->GetPage(1); + CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL ); + + SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pPage->GetObj(0) ); + CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != NULL); + + const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); + const SvxNumBulletItem *pNumFmt = dynamic_cast<const SvxNumBulletItem *>(aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET)); + CPPUNIT_ASSERT(pNumFmt); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's color is wrong!", sal_uInt32(0xff0000),pNumFmt->GetNumRule()->GetLevel(0).GetBulletColor().GetColor()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |