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:
@@ -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
BIN
sw/qa/extras/ooxmlimport/data/tdf100830.docx
Normal file → Executable file
Binary file not shown.
@@ -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();
|
||||
|
Reference in New Issue
Block a user