summaryrefslogtreecommitdiff
path: root/oox/source/drawingml
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-05-22 16:05:23 +0200
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-05-23 10:04:00 +0200
commitb5f6a5cfc517ecd8aa6ba96471d854b07b92ebaa (patch)
treec13eb4badf6272158be9adae54099632a1b9fbb7 /oox/source/drawingml
parent2e68a1468c035fc3bb4d02ad0b3187872fe1e67b (diff)
ooxml: Do not repeat wdp files in artistic effects
When two pictures apply different effects to the same picture, it is only saved once in the original document. Added a cache to DrawingML to know if the picture has already been exported, and added a test for it. Change-Id: Ia25f3d8f2f46d61f18aefc22fdfdbcdc72f2d916
Diffstat (limited to 'oox/source/drawingml')
-rw-r--r--oox/source/drawingml/fillproperties.cxx8
-rw-r--r--oox/source/drawingml/fillpropertiesgroupcontext.cxx3
2 files changed, 10 insertions, 1 deletions
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index 7d816758f459..96770425b047 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -619,8 +619,14 @@ css::beans::PropertyValue ArtisticEffectProperties::getEffect()
if( mrOleObjectInfo.maEmbeddedData.hasElements() )
{
+ css::uno::Sequence< css::beans::PropertyValue > aGraphicSeq( 2 );
+ aGraphicSeq[0].Name = "Id";
+ aGraphicSeq[0].Value = uno::makeAny( mrOleObjectInfo.maProgId );
+ aGraphicSeq[1].Name = "Data";
+ aGraphicSeq[1].Value = uno::makeAny( mrOleObjectInfo.maEmbeddedData );
+
aSeq[i].Name = "OriginalGraphic";
- aSeq[i].Value = uno::makeAny( mrOleObjectInfo.maEmbeddedData );
+ aSeq[i].Value = uno::makeAny( aGraphicSeq );
}
pRet.Name = msName;
diff --git a/oox/source/drawingml/fillpropertiesgroupcontext.cxx b/oox/source/drawingml/fillpropertiesgroupcontext.cxx
index ac8f215a9d03..e60f68947738 100644
--- a/oox/source/drawingml/fillpropertiesgroupcontext.cxx
+++ b/oox/source/drawingml/fillpropertiesgroupcontext.cxx
@@ -339,7 +339,10 @@ ContextHandlerRef ArtisticEffectContext::onCreateContext(
{
OUString aFragmentPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( embed ), OUString() ) );
if( !aFragmentPath.isEmpty() )
+ {
getFilter().importBinaryData( maEffect.mrOleObjectInfo.maEmbeddedData, aFragmentPath );
+ maEffect.mrOleObjectInfo.maProgId = aFragmentPath;
+ }
}
return new ArtisticEffectContext( *this, maEffect );
}