diff options
author | PriyankaGaikwad <priyanka.gaikwad@synerzip.com> | 2015-04-06 16:17:03 +0530 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-05-11 19:42:24 +0000 |
commit | 0c3b96790da88fb22b5e932f9a4abaeb330b610a (patch) | |
tree | 2b1cf5fd86828a54962d79af61f606aeba0c4523 /sd | |
parent | 5ffe469a9e9c5b86dbdcbe556d23cd789a9f3a55 (diff) |
tdf#90174 FILESAVE: export of bullet color for pptx
Added pptx export support for bullet color.
Change-Id: I0c7713a6d2161e1ecbe0d7f5778e78791e9759cd
Reviewed-on: https://gerrit.libreoffice.org/15169
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@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 | 29 |
2 files changed, 29 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 bfb89135acc6..70744f0a54d8 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -99,6 +99,7 @@ public: void testCellLeftAndRightMargin(); void testRightToLeftParaghraph(); void testTableCellBorder(); + void testBulletColor(); #if !defined WNT void testBnc822341(); @@ -128,6 +129,7 @@ public: CPPUNIT_TEST(testCellLeftAndRightMargin); CPPUNIT_TEST(testRightToLeftParaghraph); CPPUNIT_TEST(testTableCellBorder); + CPPUNIT_TEST(testBulletColor); #if !defined WNT CPPUNIT_TEST(testBnc822341); @@ -878,6 +880,33 @@ void SdExportTest::testRightToLeftParaghraph() xDocShRef->DoClose(); } + +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()); +} + #if !defined WNT void SdExportTest::testBnc822341() |