summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/inc/oox/vml/vmlformatting.hxx5
-rw-r--r--oox/source/vml/vmlformatting.cxx7
-rw-r--r--oox/source/vml/vmlshapecontext.cxx3
3 files changed, 12 insertions, 3 deletions
diff --git a/oox/inc/oox/vml/vmlformatting.hxx b/oox/inc/oox/vml/vmlformatting.hxx
index 0d8db1678769..d6752551e80b 100644
--- a/oox/inc/oox/vml/vmlformatting.hxx
+++ b/oox/inc/oox/vml/vmlformatting.hxx
@@ -228,11 +228,14 @@ struct FillModel
/** The shadow model structure contains all shape shadow properties. */
struct ShadowModel
{
- OptValue<bool> moHasShadow; ///< Specifies whether to show a shadow.
+ bool mbHasShadow; ///< Is a v:shadow element seen?
+ OptValue<bool> moShadowOn; ///< Is the element turned on?
OptValue<OUString> moColor; ///< Specifies the color of the shadow.
OptValue<OUString> moOffset; ///< Specifies the shadow's offset from the shape's location.
OptValue<double> moOpacity; ///< Specifies the opacity of the shadow.
+ ShadowModel();
+
/** Writes the properties to the passed property map. */
void pushToPropMap(oox::drawingml::ShapePropertyMap& rPropMap, const GraphicHelper& rGraphicHelper) const;
};
diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index 3113d57b4dd5..1af17a3886f7 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -714,9 +714,14 @@ void FillModel::pushToPropMap( ShapePropertyMap& rPropMap, const GraphicHelper&
// ============================================================================
+ShadowModel::ShadowModel()
+ : mbHasShadow(false)
+{
+}
+
void ShadowModel::pushToPropMap(ShapePropertyMap& rPropMap, const GraphicHelper& rGraphicHelper) const
{
- if (moHasShadow.has() && !moHasShadow.get())
+ if (!mbHasShadow || (moShadowOn.has() && !moShadowOn.get()))
return;
drawingml::Color aColor = ConversionHelper::decodeColor(rGraphicHelper, moColor, moOpacity, API_RGB_GRAY);
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index fc5ad9f44cb6..39ac32595a6d 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -335,7 +335,8 @@ ContextHandlerRef ShapeTypeContext::onCreateContext( sal_Int32 nElement, const A
break;
case VML_TOKEN( shadow ):
{
- mrTypeModel.maShadowModel.moHasShadow.assignIfUsed(lclDecodeBool(rAttribs, XML_on));
+ mrTypeModel.maShadowModel.mbHasShadow = true;
+ mrTypeModel.maShadowModel.moShadowOn.assignIfUsed(lclDecodeBool(rAttribs, XML_on));
mrTypeModel.maShadowModel.moColor.assignIfUsed(rAttribs.getString(XML_color));
mrTypeModel.maShadowModel.moOffset.assignIfUsed(rAttribs.getString(XML_offset));
mrTypeModel.maShadowModel.moOpacity = lclDecodePercent(rAttribs, XML_opacity, 1.0);