summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@suse.com>2013-04-26 13:25:11 +0200
committerThorsten Behrens <tbehrens@suse.com>2013-04-26 13:35:25 +0200
commitd56ba7ee6f385866d82142aab568a159009ae69e (patch)
tree585de3664b48ab71345428e4730aef7e78c1a9f4 /oox
parent35f86a72df84b905fd2297f8a08c75e91f43d604 (diff)
Fix bnc#705982 - make animations inside SmartArt work.
With the fallback loading of extDrawing for SmartArt graphics, slideshow animations into that drawingml fragment didn't work - for it being modelId diagram references instead of plain shape IDs. So use the modelId if present, and only then fallback to shape id. Change-Id: Iac2b8bc16255611d7ab165b72fb251cd2a65073a
Diffstat (limited to 'oox')
-rw-r--r--oox/source/ppt/animationspersist.cxx8
-rw-r--r--oox/source/ppt/pptshape.cxx13
-rw-r--r--oox/source/ppt/pptshapegroupcontext.cxx3
-rw-r--r--oox/source/ppt/timetargetelementcontext.cxx6
4 files changed, 26 insertions, 4 deletions
diff --git a/oox/source/ppt/animationspersist.cxx b/oox/source/ppt/animationspersist.cxx
index d905c0e2bb9d..1405a6ecc376 100644
--- a/oox/source/ppt/animationspersist.cxx
+++ b/oox/source/ppt/animationspersist.cxx
@@ -97,8 +97,14 @@ namespace oox { namespace ppt {
break;
case XML_spTgt:
{
+ OUString sShapeName = msValue;
+
+ // bnc#705982 - catch referenced diagram fallback shapes
+ if( maShapeTarget.mnType == XML_dgm )
+ sShapeName = maShapeTarget.msSubShapeId;
+
Any rTarget;
- ::oox::drawingml::ShapePtr pShape = pSlide->getShape(msValue);
+ ::oox::drawingml::ShapePtr pShape = pSlide->getShape(sShapeName);
SAL_WARN_IF( !pShape, "oox.ppt", "failed to locate Shape");
if( pShape )
{
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index a91ecbb2ae6f..740858e53406 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -347,9 +347,18 @@ void PPTShape::addShape(
}
}
- if( pShapeMap && !msId.isEmpty() )
+ if( pShapeMap )
{
- (*pShapeMap)[ msId ] = shared_from_this();
+ // bnc#705982 - if optional model id reference is
+ // there, use that to obtain target shape
+ if( !msModelId.isEmpty() )
+ {
+ (*pShapeMap)[ msModelId ] = shared_from_this();
+ }
+ else if( !msId.isEmpty() )
+ {
+ (*pShapeMap)[ msId ] = shared_from_this();
+ }
}
// if this is a group shape, we have to add also each child shape
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index c77353cff448..ad5267e247a9 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -101,7 +101,7 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s
case PPT_TOKEN( sp ): // Shape
{
AttributeList aAttribs( xAttribs );
- oox::drawingml::ShapePtr pShape = oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.CustomShape" ) );
+ boost::shared_ptr<PPTShape> pShape( new PPTShape( meShapeLocation, "com.sun.star.drawing.CustomShape" ) );
if( aAttribs.getBool( XML_useBgFill, false ) )
{
::oox::drawingml::FillProperties &aFill = pShape->getFillProperties();
@@ -110,6 +110,7 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s
// TODO: We are using white here, because thats the closest we can assume (?)
aFill.maFillColor.setSrgbClr( API_RGB_WHITE );
}
+ pShape->setModelId(xAttribs->getOptionalValue( XML_modelId ));
xRet.set( new PPTShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, pShape ) );
}
break;
diff --git a/oox/source/ppt/timetargetelementcontext.cxx b/oox/source/ppt/timetargetelementcontext.cxx
index 388a88d4e93b..e8c59a8913df 100644
--- a/oox/source/ppt/timetargetelementcontext.cxx
+++ b/oox/source/ppt/timetargetelementcontext.cxx
@@ -65,6 +65,12 @@ namespace oox { namespace ppt {
maShapeTarget.msSubShapeId = rAttribs.getString( XML_spid, OUString() );
return this;
case PPT_TOKEN( graphicEl ):
+ return this; // needs a:dgm for the target
+ case A_TOKEN( dgm ):
+ bTargetSet = true;
+ maShapeTarget.mnType = XML_dgm;
+ maShapeTarget.msSubShapeId = rAttribs.getString( XML_id, OUString() );
+ return this;
case PPT_TOKEN( oleChartEl ):
bTargetSet = true;
// TODO