From 3b7fa9b723bf4377077517b4e09cdba647a26a90 Mon Sep 17 00:00:00 2001 From: Gülşah Köse Date: Thu, 28 Jan 2021 09:37:58 +0300 Subject: tdf#134210 Apply mirror property to custom cropped graphic. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5bf2ba8fa432af8b6a560cc60c18bef799834fd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110039 Tested-by: Jenkins Reviewed-by: Gülşah Köse Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110663 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna --- sd/qa/unit/data/pptx/mirrored-graphic.pptx | Bin 0 -> 173805 bytes sd/qa/unit/import-tests.cxx | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 sd/qa/unit/data/pptx/mirrored-graphic.pptx (limited to 'sd') diff --git a/sd/qa/unit/data/pptx/mirrored-graphic.pptx b/sd/qa/unit/data/pptx/mirrored-graphic.pptx new file mode 100644 index 000000000000..c7cd6a406947 Binary files /dev/null and b/sd/qa/unit/data/pptx/mirrored-graphic.pptx differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index e3bd40f091eb..d75c89185f66 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -208,6 +208,7 @@ public: void testTdf126324(); void testTdf128684(); void testTdf119187(); + void testMirroredGraphic(); bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, std::vector& rExpected); void testPatternImport(); @@ -334,6 +335,7 @@ public: CPPUNIT_TEST(testTdf128684); CPPUNIT_TEST(testTdf113198); CPPUNIT_TEST(testTdf119187); + CPPUNIT_TEST(testMirroredGraphic); CPPUNIT_TEST_SUITE_END(); }; @@ -3222,6 +3224,20 @@ void SdImportTest::testTdf119187() } } +void SdImportTest::testMirroredGraphic() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/mirrored-graphic.pptx"), PPTX); + uno::Reference xShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_SET_THROW); + CPPUNIT_ASSERT(xShape.is()); + uno::Reference xGraphic; + xShape->getPropertyValue("FillBitmap") >>= xGraphic; + CPPUNIT_ASSERT(xGraphic.is()); + Graphic aGraphic(xGraphic); + BitmapEx aBitmap(aGraphic.GetBitmapEx()); + CPPUNIT_ASSERT_EQUAL( Color(5196117), aBitmap.GetPixelColor( 0, 0 )); + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit