tdf#100830 drawingML import: handle <a:alphaModFix>
Fill transparency on the UI. Regression from commit
57450afb76
(DOCX import: declare wps as a
supported feature, 2013-12-03), as the VML import handled this.
Change-Id: I654b51d51448d25d400979a4a62189b86126ac01
Reviewed-on: https://gerrit.libreoffice.org/29517
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
This commit is contained in:
@@ -121,6 +121,7 @@ struct BlipFillProperties
|
|||||||
Color maDuotoneColors[2]; /// Duotone Colors
|
Color maDuotoneColors[2]; /// Duotone Colors
|
||||||
|
|
||||||
ArtisticEffectProperties maEffect; /// Artistic effect, not supported by core.
|
ArtisticEffectProperties maEffect; /// Artistic effect, not supported by core.
|
||||||
|
OptValue<sal_Int32> moAlphaModFix; ///< Alpha Modulate Fixed Effect.
|
||||||
|
|
||||||
/** Overwrites all members that are explicitly set in rSourceProps. */
|
/** Overwrites all members that are explicitly set in rSourceProps. */
|
||||||
void assignUsed( const BlipFillProperties& rSourceProps );
|
void assignUsed( const BlipFillProperties& rSourceProps );
|
||||||
|
@@ -205,6 +205,7 @@ void BlipFillProperties::assignUsed( const BlipFillProperties& rSourceProps )
|
|||||||
maDuotoneColors[0].assignIfUsed( rSourceProps.maDuotoneColors[0] );
|
maDuotoneColors[0].assignIfUsed( rSourceProps.maDuotoneColors[0] );
|
||||||
maDuotoneColors[1].assignIfUsed( rSourceProps.maDuotoneColors[1] );
|
maDuotoneColors[1].assignIfUsed( rSourceProps.maDuotoneColors[1] );
|
||||||
maEffect.assignUsed( rSourceProps.maEffect );
|
maEffect.assignUsed( rSourceProps.maEffect );
|
||||||
|
moAlphaModFix.assignIfUsed(rSourceProps.moAlphaModFix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FillProperties::assignUsed( const FillProperties& rSourceProps )
|
void FillProperties::assignUsed( const FillProperties& rSourceProps )
|
||||||
@@ -652,6 +653,9 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (maBlipProps.moAlphaModFix.has())
|
||||||
|
rPropMap.setProperty(ShapeProperty::FillTransparency, static_cast<sal_Int16>(maBlipProps.moAlphaModFix.get() / PER_PERCENT));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@@ -190,6 +190,9 @@ ContextHandlerRef BlipContext::onCreateContext(
|
|||||||
mrBlipProps.moBrightness = rAttribs.getInteger( XML_bright );
|
mrBlipProps.moBrightness = rAttribs.getInteger( XML_bright );
|
||||||
mrBlipProps.moContrast = rAttribs.getInteger( XML_contrast );
|
mrBlipProps.moContrast = rAttribs.getInteger( XML_contrast );
|
||||||
break;
|
break;
|
||||||
|
case A_TOKEN( alphaModFix ):
|
||||||
|
mrBlipProps.moAlphaModFix = rAttribs.getInteger(XML_amt);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
BIN
sw/qa/extras/ooxmlimport/data/tdf100830.docx
Normal file
BIN
sw/qa/extras/ooxmlimport/data/tdf100830.docx
Normal file
Binary file not shown.
@@ -3294,6 +3294,12 @@ DECLARE_OOXMLIMPORT_TEST(testTdf99140, "tdf99140.docx")
|
|||||||
CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::LEFT_AND_WIDTH, getProperty<sal_Int16>(xTableProperties, "HoriOrient"));
|
CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::LEFT_AND_WIDTH, getProperty<sal_Int16>(xTableProperties, "HoriOrient"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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_PLUGIN_IMPLEMENT();
|
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
Reference in New Issue
Block a user