summaryrefslogtreecommitdiffstats
path: root/oox
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-01-28 13:39:11 +0100
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-01-28 17:07:26 +0100
commit0d6cb9c123e04585c6adb92a2891048ca2442bac (patch)
tree0f92e97cd0596b265146ecd9f4cf35d242341cd1 /oox
parentgive MSVC a hint to not break the build, fdo#74042 related (diff)
downloadcore-0d6cb9c123e04585c6adb92a2891048ca2442bac.tar.gz
core-0d6cb9c123e04585c6adb92a2891048ca2442bac.zip
ooxml: Preserve shape style effect attributes
Preserve <a:effectRef> tag and its contents from inside shape style properties tag <wps:style>. Added some lines to existing unit tests to check for the preservation of these attributes. Change-Id: I6e47b228dcc9788a4a2dfe87bd1186d2f04dbeea
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/shape.cxx10
-rw-r--r--oox/source/export/drawingml.cxx8
2 files changed, 14 insertions, 4 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 41fe7fd429d2..b2d03008e442 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -605,6 +605,16 @@ Reference< XShape > Shape::createAndInsert(
aEffectProperties.assignUsed( *pEffectProps );
// TODO: use ph color when applying effect properties
// nEffectPhClr = pEffectRef->maPhClr.getColor( rGraphicHelper );
+
+ // Store style-related properties to InteropGrabBag to be able to export them back
+ Sequence< PropertyValue > aProperties( 3 );
+ PUT_PROP( aProperties, 0, "SchemeClr", pEffectRef->maPhClr.getSchemeName() );
+ PUT_PROP( aProperties, 1, "Idx", pEffectRef->mnThemedIdx );
+ PUT_PROP( aProperties, 2, "Transformations", pEffectRef->maPhClr.getTransformations() );
+ PropertyValue pStyleFillRef;
+ pStyleFillRef.Name = "StyleEffectRef";
+ pStyleFillRef.Value = Any( aProperties );
+ putPropertyToGrabBag( pStyleFillRef );
}
}
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 70f4f3b5d0cf..3b84ea0ff8b9 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1794,20 +1794,20 @@ void DrawingML::WriteShapeStyle( Reference< XPropertySet > xPropSet )
// extract the relevant properties from the grab bag
Sequence< PropertyValue > aGrabBag;
- Sequence< PropertyValue > aFillRefProperties;
- Sequence< PropertyValue > aLnRefProperties;
+ Sequence< PropertyValue > aFillRefProperties, aLnRefProperties, aEffectRefProperties;
mAny >>= aGrabBag;
for( sal_Int32 i=0; i < aGrabBag.getLength(); ++i)
if( aGrabBag[i].Name == "StyleFillRef" )
aGrabBag[i].Value >>= aFillRefProperties;
else if( aGrabBag[i].Name == "StyleLnRef" )
aGrabBag[i].Value >>= aLnRefProperties;
+ else if( aGrabBag[i].Name == "StyleEffectRef" )
+ aGrabBag[i].Value >>= aEffectRefProperties;
WriteStyleProperties( XML_lnRef, aLnRefProperties );
WriteStyleProperties( XML_fillRef, aFillRefProperties );
+ WriteStyleProperties( XML_effectRef, aEffectRefProperties );
- // write mock <a:effectRef>
- mpFS->singleElementNS( XML_a, XML_effectRef, XML_idx, I32S( 0 ), FSEND );
// write mock <a:fontRef>
mpFS->singleElementNS( XML_a, XML_fontRef, XML_idx, "minor", FSEND );
}