tdf#102997 Fix Error in OOXML Transparency Conversion Math

This fixes the import logic for tdf#100830 to handle transparencies other than 50%.

Change-Id: If4e2e369a9674488878bb0a4378d48292ea4e0cb
Reviewed-on: https://gerrit.libreoffice.org/29581
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
This commit is contained in:
lbenes
2016-10-06 15:57:22 -04:00
committed by Miklos Vajna
parent bf25013d43
commit ade43e6a86
3 changed files with 2 additions and 2 deletions

View File

@@ -655,7 +655,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
}
if (maBlipProps.moAlphaModFix.has())
rPropMap.setProperty(ShapeProperty::FillTransparency, static_cast<sal_Int16>(maBlipProps.moAlphaModFix.get() / PER_PERCENT));
rPropMap.setProperty(ShapeProperty::FillTransparency, static_cast<sal_Int16>(100 - (maBlipProps.moAlphaModFix.get() / PER_PERCENT)));
}
break;

BIN
sw/qa/extras/ooxmlimport/data/tdf100830.docx Normal file → Executable file

Binary file not shown.

View File

@@ -3297,7 +3297,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf99140, "tdf99140.docx")
DECLARE_OOXMLIMPORT_TEST(testTdf100830, "tdf100830.docx")
{
// FillTransparence wasn't imported, this was 0.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(50), getProperty<sal_Int16>(getShape(1), "FillTransparence"));
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(30), getProperty<sal_Int16>(getShape(1), "FillTransparence"));
}
CPPUNIT_PLUGIN_IMPLEMENT();