diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-05-12 11:46:50 +0200 |
---|---|---|
committer | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-05-13 10:28:54 +0200 |
commit | e8679367c9020c22a787f441c4d5a43647986e0f (patch) | |
tree | 347698f62e231a5dc69ba42bec0869a02eb60ade /oox/source/drawingml/shape3dproperties.cxx | |
parent | ac9f7c8d1abffe882093f93ea70dc5e31d28a7a2 (diff) |
ooxml: Preserve shape 3d effects: material
Shapes 3D effects can specify a material like in the following example:
<a:sp3d prstMaterial="metal" z="488950" />
This patch preserves the prstMaterial attribute in the sp3d tag using
the shape grab bag and modifies an existing unit test to add this
check.
Change-Id: I7be2dbbcc7e599d5f0fb8fa53ec1d180c18d8ebd
Diffstat (limited to 'oox/source/drawingml/shape3dproperties.cxx')
-rw-r--r-- | oox/source/drawingml/shape3dproperties.cxx | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/oox/source/drawingml/shape3dproperties.cxx b/oox/source/drawingml/shape3dproperties.cxx index 28d907922b31..9bb434ab3718 100644 --- a/oox/source/drawingml/shape3dproperties.cxx +++ b/oox/source/drawingml/shape3dproperties.cxx @@ -192,6 +192,31 @@ OUString Shape3DProperties::getBevelPresetTypeString( sal_Int32 nType ) return OUString(); } +OUString Shape3DProperties::getPresetMaterialTypeString( sal_Int32 nType ) +{ + switch (nType) + { + case XML_legacyMatte: return OUString("legacyMatte"); + case XML_legacyPlastic: return OUString("legacyPlastic"); + case XML_legacyMetal: return OUString("legacyMetal"); + case XML_legacyWireframe: return OUString("legacyWireframe"); + case XML_matte: return OUString("matte"); + case XML_plastic: return OUString("plastic"); + case XML_metal: return OUString("metal"); + case XML_warmMatte: return OUString("warmMatte"); + case XML_translucentPowder: return OUString("translucentPowder"); + case XML_powder: return OUString("powder"); + case XML_dkEdge: return OUString("dkEdge"); + case XML_softEdge: return OUString("softEdge"); + case XML_clear: return OUString("clear"); + case XML_flat: return OUString("flat"); + case XML_softmetal: return OUString("softmetal"); + case XML_none: return OUString("none"); + } + SAL_WARN( "oox.drawingml", "Shape3DProperties::getPresetMaterialTypeString - unexpected token" ); + return OUString(); +} + css::uno::Sequence< css::beans::PropertyValue > Shape3DProperties::getCameraAttributes() { css::uno::Sequence<css::beans::PropertyValue> aSeq(6); @@ -302,7 +327,7 @@ css::uno::Sequence< css::beans::PropertyValue > Shape3DProperties::getBevelAttri css::uno::Sequence< css::beans::PropertyValue > Shape3DProperties::getShape3DAttributes() { - css::uno::Sequence<css::beans::PropertyValue> aSeq(5); + css::uno::Sequence<css::beans::PropertyValue> aSeq(6); sal_Int32 nSize = 0; if( mnExtrusionH.has() ) { @@ -322,6 +347,12 @@ css::uno::Sequence< css::beans::PropertyValue > Shape3DProperties::getShape3DAtt aSeq[nSize].Value = css::uno::Any( mnShapeZ.use() ); nSize++; } + if( mnMaterial.has() ) + { + aSeq[nSize].Name = "prstMaterial"; + aSeq[nSize].Value = css::uno::Any( getPresetMaterialTypeString( mnMaterial.use() ) ); + nSize++; + } if( maTopBevelProperties.has() ) { aSeq[nSize].Name = "bevelT"; |