Kaydet (Commit) a7b611e8 authored tarafından PriyankaGaikwad's avatar PriyankaGaikwad Kaydeden (comit) David Tardon

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/14890Tested-by: 's avatarJenkins <ci@libreoffice.org>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst 63442ec6
...@@ -225,7 +225,9 @@ ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl ...@@ -225,7 +225,9 @@ ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl
} }
case A_TOKEN( buChar ): // CT_TextCharBullet case A_TOKEN( buChar ): // CT_TextCharBullet
try { try {
mrBulletList.setBulletChar( rAttribs.getString( XML_char ).get() ); mrBulletList.setBulletChar( rAttribs.getString( XML_char ).get() );
mrBulletList.setSuffixNone();
} }
catch(SAXException& /* e */) catch(SAXException& /* e */)
{ {
......
...@@ -96,6 +96,7 @@ public: ...@@ -96,6 +96,7 @@ public:
void testBnc862510_7(); void testBnc862510_7();
void testPDFImport(); void testPDFImport();
void testPDFImportSkipImages(); void testPDFImportSkipImages();
void testBulletSuffix();
CPPUNIT_TEST_SUITE(SdImportTest); CPPUNIT_TEST_SUITE(SdImportTest);
...@@ -130,6 +131,7 @@ public: ...@@ -130,6 +131,7 @@ public:
CPPUNIT_TEST(testBnc862510_7); CPPUNIT_TEST(testBnc862510_7);
CPPUNIT_TEST(testPDFImport); CPPUNIT_TEST(testPDFImport);
CPPUNIT_TEST(testPDFImportSkipImages); CPPUNIT_TEST(testPDFImportSkipImages);
CPPUNIT_TEST(testBulletSuffix);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
}; };
...@@ -1112,6 +1114,29 @@ void SdImportTest::testPDFImportSkipImages() ...@@ -1112,6 +1114,29 @@ void SdImportTest::testPDFImportSkipImages()
xDocShRef->DoClose(); 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_TEST_SUITE_REGISTRATION(SdImportTest);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment