diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2020-07-21 15:46:51 +0200 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2020-07-22 11:54:04 +0200 |
commit | 51e5afb0042bc6a10f0cd02af5733079b42fa0f7 (patch) | |
tree | 4a115d674aaebf043eb95f762cfe26cdde6e33f1 /sd/qa/unit/export-tests-ooxml1.cxx | |
parent | 14bdbc36f0cf3913f6de10c746044b6aadf37095 (diff) |
tdf#134969 Add solid transparence in color gradient
Converts a 'FillTransparence' percent value to a Gray color and
stores it in a TransparenceGradient, so that it can be used by
WriteGradientFill(). Use of third parameter rXPropSet is not possible,
because it would overwrite a true transparency gradient.
Causion, the property 'FillTransparenceGradient' might exist in an
XPropSet of a shape with some default values. To detect, whether a
gradient is actually used, you have to examine the property
'FillTransparenceGradientName'.
Change-Id: Icbef599f02ebae2fcb5825fe64f546295eb78510
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99145
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'sd/qa/unit/export-tests-ooxml1.cxx')
-rw-r--r-- | sd/qa/unit/export-tests-ooxml1.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 5cde7f0c8b91..f8f471f08b9a 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -97,6 +97,7 @@ public: void testTdf128345GradientLinear(); void testTdf128345GradientRadial(); void testTdf128345GradientAxial(); + void testTdf134969TransparencyOnColorGradient(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest1); @@ -143,6 +144,7 @@ public: CPPUNIT_TEST(testTdf128345GradientLinear); CPPUNIT_TEST(testTdf128345GradientRadial); CPPUNIT_TEST(testTdf128345GradientAxial); + CPPUNIT_TEST(testTdf134969TransparencyOnColorGradient); CPPUNIT_TEST_SUITE_END(); @@ -1212,6 +1214,22 @@ void SdOOXMLExportTest1::testTdf128345GradientAxial() xDocShRef->DoClose(); } +void SdOOXMLExportTest1::testTdf134969TransparencyOnColorGradient() +{ + ::sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf134969_TransparencyOnColorGradient.odp"), ODP); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + xDocShRef->DoClose(); + + // Make sure the shape has a transparency in gradient stops. + xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml"); + const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs",2); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val", "60000"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val", "60000"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1); CPPUNIT_PLUGIN_IMPLEMENT(); |