sd/qa/unit/data/odp/tdf141269.odp |binary sd/qa/unit/export-tests.cxx | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+)
New commits: commit 016da0cece1f01a36f2417f5fbcab3a506f47303 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Apr 15 13:39:41 2021 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Apr 15 22:11:08 2021 +0200 tdf#141269: sd_export: Add unittest Change-Id: I0c7f9a1219ce9fef3b619856ff0c11b36d9cf56d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114144 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sd/qa/unit/data/odp/tdf141269.odp b/sd/qa/unit/data/odp/tdf141269.odp new file mode 100644 index 000000000000..dfce4e064a85 Binary files /dev/null and b/sd/qa/unit/data/odp/tdf141269.odp differ diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index d71c8da4da20..3c95f8290693 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -76,6 +76,7 @@ public: void testBulletsAsImage(); void testTdf113818(); void testTdf119629(); + void testTdf141269(); void testTdf123557(); void testTdf113822(); void testTdf126761(); @@ -117,6 +118,7 @@ public: CPPUNIT_TEST(testBulletsAsImage); CPPUNIT_TEST(testTdf113818); CPPUNIT_TEST(testTdf119629); + CPPUNIT_TEST(testTdf141269); CPPUNIT_TEST(testTdf123557); CPPUNIT_TEST(testTdf113822); CPPUNIT_TEST(testTdf126761); @@ -1209,6 +1211,35 @@ void SdExportTest::testTdf119629() xDocShRef->DoClose(); } +void SdExportTest::testTdf141269() +{ + utl::TempFile tempFile; + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf141269.odp"), ODP); + xDocShRef = saveAndReload(xDocShRef.get(), PPT); + + uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_SET_THROW); + CPPUNIT_ASSERT(xShape.is()); + + uno::Reference<graphic::XGraphic> xGraphic; + xShape->getPropertyValue("Graphic") >>= xGraphic; + CPPUNIT_ASSERT(xGraphic.is()); + + Graphic aGraphic(xGraphic); + BitmapEx aBitmap(aGraphic.GetBitmapEx()); + CPPUNIT_ASSERT_EQUAL(tools::Long(1920), aBitmap.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(tools::Long(1080), aBitmap.GetSizePixel().Height()); + + Color aExpectedColor(0xC2DEEA); + aExpectedColor.SetAlpha(0xF); + + // Without the fix in place, this test would have failed with + // - Expected: Color: R:194 G:222 B:234 A:240 + // - Actual : Color: R:194 G:222 B:234 A:15 + CPPUNIT_ASSERT_EQUAL(aExpectedColor, aBitmap.GetPixelColor(960, 540)); + + xDocShRef->DoClose(); +} + void SdExportTest::testTdf123557() { utl::TempFile tempFile; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits