diff options
Diffstat (limited to 'sd/qa/unit/import-tests.cxx')
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
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(); |