summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPriyankaGaikwad <priyanka.gaikwad@synerzip.com>2015-03-17 16:20:29 +0530
committerDavid Tardon <dtardon@redhat.com>2015-03-20 08:24:26 +0000
commita7b611e8fb62d6e93844e5e7b9f1f00adb4afeea (patch)
tree79dc449ee637cb6973d21069b54d820d4ca43f4a
parent63442ec636d637e05d7d585817df531dbbeb96d9 (diff)
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 <ci@libreoffice.org> Tested-by: David Tardon <dtardon@redhat.com> Reviewed-by: David Tardon <dtardon@redhat.com>
-rw-r--r--oox/source/drawingml/textparagraphpropertiescontext.cxx2
-rw-r--r--sd/qa/unit/data/pptx/n83889.pptxbin0 -> 33401 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx25
3 files changed, 27 insertions, 0 deletions
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index 06c6625bd178..a79cfe0287b2 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 000000000000..e2f0b1386bfb
--- /dev/null
+++ b/sd/qa/unit/data/pptx/n83889.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 972f8bc14b64..5d6885920193 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();