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.extern@allotropia.de>
This commit is contained in:
Sarper Akdemir
2023-09-08 08:58:02 +02:00
parent edd121dd66
commit b0e8ce9967
3 changed files with 17 additions and 1 deletions
+3 -1
View File
@@ -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);
Binary file not shown.
+14
View File
@@ -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");