sd/qa/unit/data/pptx/tdf138148.pptx |binary sd/qa/unit/import-tests.cxx | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+)
New commits: commit 5c2c0bc671a50d05a8459c213787f426fb5de2d7 Author: Xisco Fauli <[email protected]> AuthorDate: Thu Nov 19 15:38:49 2020 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Thu Nov 19 20:07:27 2020 +0100 tdf#138148: sd_import: Add unittest Change-Id: I0df14348618efed2806411eddf41a4964512211d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106171 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sd/qa/unit/data/pptx/tdf138148.pptx b/sd/qa/unit/data/pptx/tdf138148.pptx new file mode 100644 index 000000000000..76237c602c92 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf138148.pptx differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index acac88729506..ac05fef9d1c8 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -200,6 +200,7 @@ public: void testTdf108926(); void testTdf100065(); void testTdf90626(); + void testTdf138148(); void testTdf114488(); void testTdf134174(); void testTdf114913(); @@ -312,6 +313,7 @@ public: CPPUNIT_TEST(testTdf108926); CPPUNIT_TEST(testTdf100065); CPPUNIT_TEST(testTdf90626); + CPPUNIT_TEST(testTdf138148); CPPUNIT_TEST(testTdf114488); CPPUNIT_TEST(testTdf134174); CPPUNIT_TEST(testTdf114913); @@ -2643,6 +2645,28 @@ void SdImportTest::testTdf90626() xDocShRef->DoClose(); } +void SdImportTest::testTdf138148() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf138148.pptx"), PPTX); + const SdrPage *pPage = GetPage(1, xDocShRef); + SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>(pPage->GetObj(0)); + CPPUNIT_ASSERT_MESSAGE("No text object", pTxtObj != nullptr); + const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); + for(int i = 0; i < 2; i++) + { + const SvxNumBulletItem *pNumFmt = aEdit.GetParaAttribs(i).GetItem(EE_PARA_NUMBULLET); + CPPUNIT_ASSERT(pNumFmt); + CPPUNIT_ASSERT_DOUBLES_EQUAL(tools::Long(444), pNumFmt->GetNumRule()->GetLevel(0).GetGraphicSize().getHeight(), tools::Long(1)); + + // Without the fix in place, this test would have failed with + // - Expected: 148 + // - Actual : 444 + CPPUNIT_ASSERT_DOUBLES_EQUAL(tools::Long(148), pNumFmt->GetNumRule()->GetLevel(0).GetGraphicSize().getWidth(), tools::Long(1)); + } + + xDocShRef->DoClose(); +} + void SdImportTest::testTdf114488() { // This doc has two images - one WMF and the other PNG (fallback image). _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
