summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@suse.com>2012-06-25 19:25:52 +0530
committerMuthu Subramanian <sumuthu@suse.com>2012-06-25 19:25:52 +0530
commit11c5699dad06fb0d7fc0e458550a1dac82f8ee5f (patch)
treeb230cdf220a0a38d007633db818f3a9b3730f4af /oox
parentf3e7d82e7c20f8d78b418ecc92d2e22c0a3fb0dc (diff)
n#759210: Certain smartart drawings weren't imported.
SmartArt info was reset, when there was a chart (e.g.) in the same slide.
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/oox/ppt/pptshapegroupcontext.hxx1
-rw-r--r--oox/source/drawingml/diagram/diagram.cxx66
-rw-r--r--oox/source/ppt/pptshapegroupcontext.cxx14
3 files changed, 46 insertions, 35 deletions
diff --git a/oox/inc/oox/ppt/pptshapegroupcontext.hxx b/oox/inc/oox/ppt/pptshapegroupcontext.hxx
index 7e2a6d3b5f67..841e741ec247 100644
--- a/oox/inc/oox/ppt/pptshapegroupcontext.hxx
+++ b/oox/inc/oox/ppt/pptshapegroupcontext.hxx
@@ -39,6 +39,7 @@ class PPTShapeGroupContext : public ::oox::drawingml::ShapeGroupContext
SlidePersistPtr mpSlidePersistPtr;
ShapeLocation meShapeLocation;
oox::drawingml::ShapePtr pGraphicShape;
+ void importExtDrawings();
public:
PPTShapeGroupContext(
diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx
index 8e6586d82e2b..002e20a4ab25 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -395,40 +395,44 @@ void loadDiagram( ShapePtr& pShape,
pShape->addExtDrawingRelId( *aIt );
}
- // layout
- if( !rLayoutPath.isEmpty() )
+ // extLst is present, lets bet on that and ignore the rest of the data from here
+ if( !pData->getExtDrawings().size() )
{
- rtl::Reference< core::FragmentHandler > xRef(
- new DiagramLayoutFragmentHandler( rFilter, rLayoutPath, pLayout ));
- importFragment(rFilter,
- loadFragment(rFilter,xRef),
- "DiagramLayout",
- pShape,
- xRef);
- }
+ // layout
+ if( !rLayoutPath.isEmpty() )
+ {
+ rtl::Reference< core::FragmentHandler > xRef(
+ new DiagramLayoutFragmentHandler( rFilter, rLayoutPath, pLayout ));
+ importFragment(rFilter,
+ loadFragment(rFilter,xRef),
+ "DiagramLayout",
+ pShape,
+ xRef);
+ }
- // style
- if( !rQStylePath.isEmpty() )
- {
- rtl::Reference< core::FragmentHandler > xRef(
- new DiagramQStylesFragmentHandler( rFilter, rQStylePath, pDiagram->getStyles() ));
- importFragment(rFilter,
- loadFragment(rFilter,xRef),
- "DiagramQStyle",
- pShape,
- xRef);
- }
+ // style
+ if( !rQStylePath.isEmpty() )
+ {
+ rtl::Reference< core::FragmentHandler > xRef(
+ new DiagramQStylesFragmentHandler( rFilter, rQStylePath, pDiagram->getStyles() ));
+ importFragment(rFilter,
+ loadFragment(rFilter,xRef),
+ "DiagramQStyle",
+ pShape,
+ xRef);
+ }
- // colors
- if( !rColorStylePath.isEmpty() )
- {
- rtl::Reference< core::FragmentHandler > xRef(
- new ColorFragmentHandler( rFilter, rColorStylePath, pDiagram->getColors() ));
- importFragment(rFilter,
- loadFragment(rFilter,xRef),
- "DiagramColorStyle",
- pShape,
- xRef);
+ // colors
+ if( !rColorStylePath.isEmpty() )
+ {
+ rtl::Reference< core::FragmentHandler > xRef(
+ new ColorFragmentHandler( rFilter, rColorStylePath, pDiagram->getColors() ));
+ importFragment(rFilter,
+ loadFragment(rFilter,xRef),
+ "DiagramColorStyle",
+ pShape,
+ xRef);
+ }
}
// diagram loaded. now lump together & attach to shape
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index 0529ec6c9c62..bf2a99f2c2fe 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -128,6 +128,8 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s
break;
case PPT_TOKEN( graphicFrame ): // CT_GraphicalObjectFrame
{
+ if( pGraphicShape )
+ importExtDrawings();
pGraphicShape = oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.OLE2Shape" ) );
xRet.set( new oox::drawingml::GraphicalObjectFrameContext( *this, mpGroupShapePtr, pGraphicShape, true ) );
}
@@ -141,9 +143,9 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s
return xRet;
}
-void PPTShapeGroupContext::endFastElement( sal_Int32 nElement ) throw (SAXException, RuntimeException)
+void PPTShapeGroupContext::importExtDrawings( )
{
- if( nElement == PPT_TOKEN( spTree ) && pGraphicShape )
+ if( pGraphicShape )
{
for( ::std::vector<OUString>::const_iterator aIt = pGraphicShape->getExtDrawings().begin(), aEnd = pGraphicShape->getExtDrawings().end();
aIt != aEnd; ++aIt )
@@ -154,12 +156,16 @@ void PPTShapeGroupContext::endFastElement( sal_Int32 nElement ) throw (SAXExcept
mpMasterShapePtr,
mpGroupShapePtr,
pGraphicShape ) );
-
}
- pGraphicShape = oox::drawingml::ShapePtr( (PPTShape *)NULL );
+ pGraphicShape = oox::drawingml::ShapePtr( (PPTShape *)NULL );
}
}
+void PPTShapeGroupContext::endFastElement( sal_Int32 /*nElement*/ ) throw (SAXException, RuntimeException)
+{
+ importExtDrawings();
+}
+
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */