diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2021-02-08 13:30:39 +0300 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-16 12:21:28 +0100 |
commit | 65c98b76fa95fec0ff225ae032f010e5c0f246f0 (patch) | |
tree | 819badd3668f404d7881a54580bedd662ebfa100 /sd | |
parent | 1fe55d946f8f2adf4a2588dcc7d089b79611eddd (diff) |
tdf#134210 Handle greyscale effect on bitmap filled custom shapes.
Change-Id: Ia4a0828dad80e32cc0c7fe12227ffca717d62e03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110572
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110975
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/greysscale-graphic.pptx | bin | 0 -> 156595 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 16 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/greysscale-graphic.pptx b/sd/qa/unit/data/pptx/greysscale-graphic.pptx Binary files differnew file mode 100644 index 000000000000..547b60c10269 --- /dev/null +++ b/sd/qa/unit/data/pptx/greysscale-graphic.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 9aefdd4ecc7b..d6f6da8c1f83 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -218,6 +218,7 @@ public: void testShapeBlurPPTXImport(); void testMirroredGraphic(); void testCropPositionGraphic(); + void testGreysScaleGraphic(); bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected); void testPatternImport(); @@ -348,6 +349,7 @@ public: CPPUNIT_TEST(testShapeBlurPPTXImport); CPPUNIT_TEST(testMirroredGraphic); CPPUNIT_TEST(testCropPositionGraphic); + CPPUNIT_TEST(testGreysScaleGraphic); CPPUNIT_TEST_SUITE_END(); }; @@ -3340,6 +3342,20 @@ void SdImportTest::testCropPositionGraphic() xDocShRef->DoClose(); } +void SdImportTest::testGreysScaleGraphic() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/greysscale-graphic.pptx"), PPTX); + uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_SET_THROW); + CPPUNIT_ASSERT(xShape.is()); + uno::Reference<graphic::XGraphic> xGraphic; + xShape->getPropertyValue("FillBitmap") >>= xGraphic; + CPPUNIT_ASSERT(xGraphic.is()); + Graphic aGraphic(xGraphic); + BitmapEx aBitmap(aGraphic.GetBitmapEx()); + CPPUNIT_ASSERT_EQUAL( Color(3947580), aBitmap.GetPixelColor( 0, 0 )); + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |