summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-07-01 21:10:01 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-07-02 09:06:37 +0200
commit599ae1151bf893491db7ad983d64c77521c3ae9d (patch)
treea3d67407d93b694c48a6660991bfc9d387a996d8 /sd/qa
parent7d32994ad9dc45c7846664ec5ccb03bb796bb071 (diff)
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 <vmiklos@collabora.com>
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/data/pptx/tdf125554.pptxbin0 -> 32967 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml1.cxx19
2 files changed, 19 insertions, 0 deletions
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
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf125554.pptx
Binary files 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<beans::XPropertySet> xShape = getShapeFromPage(0, 0, xDocShRef);
+ uno::Any aFillTransparenceGradientName
+ = xShape->getPropertyValue("FillTransparenceGradientName");
+ CPPUNIT_ASSERT(aFillTransparenceGradientName.has<OUString>());
+ // 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<OUString>().isEmpty());
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1);
CPPUNIT_PLUGIN_IMPLEMENT();