oox/source/drawingml/fillproperties.cxx | 4 +++- sd/qa/unit/data/pptx/tdf156649.pptx |binary sd/qa/unit/export-tests.cxx | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-)
New commits: commit b0e8ce9967acf3a759e5b85c4a0d16d7dad275fe Author: Sarper Akdemir <sarper.akdemir.ext...@allotropia.de> AuthorDate: Thu Sep 7 13:53:25 2023 +0300 Commit: Sarper Akdemir <sarper.akdemir.ext...@allotropia.de> CommitDate: Fri Sep 8 08:58:02 2023 +0200 tdf#156649: oox: correct import alphaModFix for custom shapes alphaModFix should be imported into PROP_FillTransparency for custom shapes. Change-Id: I19621e424a64b097d5e6881877d60de253be636d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156660 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir.ext...@allotropia.de> diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 9f18e7d65f7d..ff78f3183831 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -866,7 +866,9 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe if ( maBlipProps.moAlphaModFix.has_value() ) { - rPropMap.setProperty(PROP_Transparency, static_cast<sal_Int16>(100 - (maBlipProps.moAlphaModFix.value() / PER_PERCENT))); + rPropMap.setProperty( + mbIsCustomShape ? PROP_FillTransparence : PROP_Transparency, + static_cast<sal_Int16>(100 - (maBlipProps.moAlphaModFix.value() / PER_PERCENT))); } } rPropMap.setProperty(PROP_GraphicColorMode, eColorMode); diff --git a/sd/qa/unit/data/pptx/tdf156649.pptx b/sd/qa/unit/data/pptx/tdf156649.pptx new file mode 100644 index 000000000000..2b3b12a9a092 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf156649.pptx differ diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 61f6736fc33f..92971d4b4221 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -1577,6 +1577,20 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf140714) CPPUNIT_ASSERT_EQUAL(OUString{ "com.sun.star.drawing.CustomShape" }, xShape->getShapeType()); } +CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf156649) +{ + createSdImpressDoc("pptx/tdf156649.pptx"); + saveAndReload("Impress Office Open XML"); + + auto xShapeProps(getShapeFromPage(0, 0)); + // Without the fix in place, this test would have failed with + //- Expected: 55 + //- Actual : 0 + // i.e. alphaModFix wasn't imported as fill transparency for the custom shape + CPPUNIT_ASSERT_EQUAL(sal_Int16(55), + xShapeProps->getPropertyValue("FillTransparence").get<sal_Int16>()); +} + CPPUNIT_TEST_FIXTURE(SdExportTest, testMasterPageBackgroundFullSize) { createSdImpressDoc("odp/background.odp");