summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-11-19 15:38:49 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2020-11-19 20:07:27 +0100
commit5c2c0bc671a50d05a8459c213787f426fb5de2d7 (patch)
tree5d32e77f7510aff7d7286f72c5de0c56a2333552 /sd
parentd242a68868efcacbbcb733a1f9fbfd5854e7724e (diff)
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/tdf138148.pptxbin0 -> 21629 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx24
2 files changed, 24 insertions, 0 deletions
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
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf138148.pptx
Binary files 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).