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>
diff --git a/sd/qa/unit/data/pptx/tdf138148.pptx b/sd/qa/unit/data/pptx/tdf138148.pptx
new file mode 100644
index 0000000..76237c6
--- /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 acac887..ac05fef 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).