From 599ae1151bf893491db7ad983d64c77521c3ae9d Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 1 Jul 2019 21:10:01 +0200 Subject: tdf#125554 PPTX export: handle gradient transparency for gradient fill Regression from commit cfc1f4ea4889f768d689a0df71519e9bcb707bc0 (oox: disable gradient fill grab-bag for PPTX, 2019-02-05), the problem was that in the past grab-bag roundtrip worked (in some cases) for this shape fill case, but true roundtrip did not. So when the commit disabled grab-bags (since their color pointers in the theme don't work in the PPTX case), a previously not implemented feature now started causing a real problem. Fix the bug by adding support for transparent linear gradients on the exports side. This means that in case the import creates both a fill gradient and a transparency gradient, then now the export creates markup based on both, not only based on the fill gradient. Change-Id: I99fa3caba2b2884c2acb7e0704bbeb0b6cffd4a4 Reviewed-on: https://gerrit.libreoffice.org/74968 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- sd/qa/unit/data/pptx/tdf125554.pptx | Bin 0 -> 32967 bytes sd/qa/unit/export-tests-ooxml1.cxx | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 sd/qa/unit/data/pptx/tdf125554.pptx (limited to 'sd/qa') diff --git a/sd/qa/unit/data/pptx/tdf125554.pptx b/sd/qa/unit/data/pptx/tdf125554.pptx new file mode 100644 index 000000000000..b78bc43fa98b Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf125554.pptx differ diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index d45b58b89504..a3df821e1bf0 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -109,6 +109,7 @@ public: void testCustomXml(); void testTdf94238(); void testPictureTransparency(); + void testTdf125554(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest1); @@ -140,6 +141,7 @@ public: CPPUNIT_TEST(testTdf112633); CPPUNIT_TEST(testCustomXml); CPPUNIT_TEST(testTdf94238); + CPPUNIT_TEST(testTdf125554); CPPUNIT_TEST(testPictureTransparency); CPPUNIT_TEST_SUITE_END(); @@ -913,6 +915,23 @@ void SdOOXMLExportTest1::testPictureTransparency() xDocShRef->DoClose(); } +void SdOOXMLExportTest1::testTdf125554() +{ + ::sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf125554.pptx"), PPTX); + xDocShRef = saveAndReload(xDocShRef.get(), PPTX); + + uno::Reference xShape = getShapeFromPage(0, 0, xDocShRef); + uno::Any aFillTransparenceGradientName + = xShape->getPropertyValue("FillTransparenceGradientName"); + CPPUNIT_ASSERT(aFillTransparenceGradientName.has()); + // Without the accompanying fix in place, this test would have failed, i.e. the transparency of + // the shape has no gradient, so it looked like a solid fill instead of a gradient fill. + CPPUNIT_ASSERT(!aFillTransparenceGradientName.get().isEmpty()); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit