tdf#49856 Add a test
Check that we get the right bullet character.
Change-Id: I2e6af6940606d3bacc71bcdf485f7c3b6fa7602b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102590
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sd/qa/unit/data/ppt/tdf49856.ppt b/sd/qa/unit/data/ppt/tdf49856.ppt
new file mode 100644
index 0000000..3e6053d
--- /dev/null
+++ b/sd/qa/unit/data/ppt/tdf49856.ppt
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 3d3032e2..a6aa1c13 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -228,6 +228,7 @@ public:
void testTdf127964();
void testTdf106638();
void testTdf113198();
void testTdf49856();
CPPUNIT_TEST_SUITE(SdImportTest);
@@ -335,6 +336,7 @@ public:
CPPUNIT_TEST(testTdf128684);
CPPUNIT_TEST(testTdf113198);
CPPUNIT_TEST(testTdf119187);
CPPUNIT_TEST(testTdf49856);
CPPUNIT_TEST(testShapeGlowEffectPPTXImpoer);
CPPUNIT_TEST(testShapeBlurPPTXImport);
@@ -3172,6 +3174,22 @@ void SdImportTest::testTdf119187()
}
}
void SdImportTest::testTdf49856()
{
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/ppt/tdf49856.ppt"), PPT);
const SdrPage *pPage = GetPage(1, xDocShRef);
SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>(pPage->GetObj(1));
CPPUNIT_ASSERT_MESSAGE("No text object", pTxtObj != nullptr);
const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
const SvxNumBulletItem *pNumFmt = aEdit.GetParaAttribs(2).GetItem(EE_PARA_NUMBULLET);
CPPUNIT_ASSERT(pNumFmt);
const sal_Unicode aBullet = pNumFmt->GetNumRule()->GetLevel(0).GetBulletChar();
CPPUNIT_ASSERT_EQUAL(OUString("More level 2"), aEdit.GetText(2));
CPPUNIT_ASSERT_EQUAL(u'\x2022', aBullet);
xDocShRef->DoClose();
}
void SdImportTest::testShapeGlowEffectPPTXImpoer()
{
sd::DrawDocShellRef xDocShRef