diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-04-15 13:39:41 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-04-15 22:11:08 +0200 |
commit | 016da0cece1f01a36f2417f5fbcab3a506f47303 (patch) | |
tree | 3a8f831a7b7d473c1fee21694b1c895088f15ad5 /sd | |
parent | aa04887fd1aee3f182b81b7c2176cccd1c69a397 (diff) |
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/odp/tdf141269.odp | bin | 0 -> 196094 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 31 |
2 files changed, 31 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odp/tdf141269.odp b/sd/qa/unit/data/odp/tdf141269.odp Binary files differnew file mode 100644 index 000000000000..dfce4e064a85 --- /dev/null +++ b/sd/qa/unit/data/odp/tdf141269.odp 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; |