diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-05-22 13:54:42 +0200 |
---|---|---|
committer | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-05-23 10:04:00 +0200 |
commit | 2e68a1468c035fc3bb4d02ad0b3187872fe1e67b (patch) | |
tree | 0bd5ccdee8253233ca7f919a70c5bd337b3b5a37 /oox/source/drawingml/fillproperties.cxx | |
parent | 642a252cf1a2f1d08c4bbfcae15527bb82c7664d (diff) |
ooxml: Preserve the original picture in artistic effects
When Word applies an artistic effect, it creates two embedded files;
one contains the bitmap with the effect and the other one contains the
original bitmap to be able to undo the effect.
This patch reads the original bitmap, stores it in the shape grab bag
and saves it back to the docx file. Added unit tests too.
TODO: right now, if two effects point to the same original bitmap it
is stored twice, we should improve this.
Change-Id: Ia72034a257739abe4ffafa0f42b2a912e4bf9436
Diffstat (limited to 'oox/source/drawingml/fillproperties.cxx')
-rw-r--r-- | oox/source/drawingml/fillproperties.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index a9ca0db37546..7d816758f459 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -608,7 +608,7 @@ css::beans::PropertyValue ArtisticEffectProperties::getEffect() if( msName.isEmpty() ) return pRet; - css::uno::Sequence< css::beans::PropertyValue > aSeq( maAttribs.size() ); + css::uno::Sequence< css::beans::PropertyValue > aSeq( maAttribs.size() + 1 ); sal_uInt32 i = 0; for( std::map< OUString, css::uno::Any >::iterator it = maAttribs.begin(); it != maAttribs.end(); ++it ) { @@ -617,6 +617,12 @@ css::beans::PropertyValue ArtisticEffectProperties::getEffect() i++; } + if( mrOleObjectInfo.maEmbeddedData.hasElements() ) + { + aSeq[i].Name = "OriginalGraphic"; + aSeq[i].Value = uno::makeAny( mrOleObjectInfo.maEmbeddedData ); + } + pRet.Name = msName; pRet.Value = css::uno::Any( aSeq ); |