summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2021-02-08 13:30:39 +0300
committerMiklos Vajna <vmiklos@collabora.com>2021-02-17 09:14:25 +0100
commit11c5329669e7a908b43a3fe51a673e8d78740f8c (patch)
tree9aa6a0ce00b38da964ae222c24846534e8d8a771 /sd
parent363b2d374be736e713c4b8aa0f7b9fda8849335b (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110965 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/greysscale-graphic.pptxbin0 -> 156595 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx16
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
new file mode 100644
index 000000000000..547b60c10269
--- /dev/null
+++ b/sd/qa/unit/data/pptx/greysscale-graphic.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index e0c725031f10..6b52466c2513 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -210,6 +210,7 @@ public:
void testTdf119187();
void testMirroredGraphic();
void testCropPositionGraphic();
+ void testGreysScaleGraphic();
bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected);
void testPatternImport();
@@ -338,6 +339,7 @@ public:
CPPUNIT_TEST(testTdf119187);
CPPUNIT_TEST(testMirroredGraphic);
CPPUNIT_TEST(testCropPositionGraphic);
+ CPPUNIT_TEST(testGreysScaleGraphic);
CPPUNIT_TEST_SUITE_END();
};
@@ -3254,6 +3256,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();