oox/source/drawingml/textparagraphpropertiescontext.cxx | 2 + sd/qa/unit/data/pptx/n83889.pptx |binary sd/qa/unit/import-tests.cxx | 25 ++++++++++++++++ 3 files changed, 27 insertions(+)
New commits: commit a7b611e8fb62d6e93844e5e7b9f1f00adb4afeea Author: PriyankaGaikwad <priyanka.gaik...@synerzip.com> Date: Tue Mar 17 16:20:29 2015 +0530 tdf#83889:FILEOPEN:PPTX bullet point is followed by spurious symbol If we have first numeric bullet and then insert any symbol bullet on same level then suffix of numeric bullet continues with symbol bullet as well. Solution : Reset suffix to none if it is symbol bullet. Change-Id: I06dddec55c6f3d8cc1545d30f7228ca08cb81396 Reviewed-on: https://gerrit.libreoffice.org/14890 Tested-by: Jenkins <c...@libreoffice.org> Tested-by: David Tardon <dtar...@redhat.com> Reviewed-by: David Tardon <dtar...@redhat.com> diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx index 06c6625..a79cfe0 100644 --- a/oox/source/drawingml/textparagraphpropertiescontext.cxx +++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx @@ -225,7 +225,9 @@ ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl } case A_TOKEN( buChar ): // CT_TextCharBullet try { + mrBulletList.setBulletChar( rAttribs.getString( XML_char ).get() ); + mrBulletList.setSuffixNone(); } catch(SAXException& /* e */) { diff --git a/sd/qa/unit/data/pptx/n83889.pptx b/sd/qa/unit/data/pptx/n83889.pptx new file mode 100644 index 0000000..e2f0b13 Binary files /dev/null and b/sd/qa/unit/data/pptx/n83889.pptx differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 972f8bc..5d68859 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -96,6 +96,7 @@ public: void testBnc862510_7(); void testPDFImport(); void testPDFImportSkipImages(); + void testBulletSuffix(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -130,6 +131,7 @@ public: CPPUNIT_TEST(testBnc862510_7); CPPUNIT_TEST(testPDFImport); CPPUNIT_TEST(testPDFImportSkipImages); + CPPUNIT_TEST(testBulletSuffix); CPPUNIT_TEST_SUITE_END(); }; @@ -1112,6 +1114,29 @@ void SdImportTest::testPDFImportSkipImages() xDocShRef->DoClose(); } +void SdImportTest::testBulletSuffix() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/n83889.pptx"), 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 ); + + // check suffix of the char bullet + 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(1).GetItem(EE_PARA_NUMBULLET)); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's suffix is wrong!", OUString(pNumFmt->GetNumRule()->GetLevel(0).GetSuffix()), OUString("") ); + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits