summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorGrzegorz Araminowicz <grzegorz.araminowicz@collabora.com>2019-03-14 08:25:12 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-03-14 14:04:02 +0100
commite9986153e44d7ec6ca9c5f1373971de74dcbacda (patch)
tree40750564a304c9856aa54c3b44d96523284c2435 /oox
parentb795e540e4c4d31618a16ca8456476d5651a4d01 (diff)
PPTX import: import SmartArt drawing into single GroupShape
before that there were imported two GroupShapes: - empty one with properties like id, name, InteropGrapBag - second one with actual shapes also fixed tests that relyed on that behaviour Change-Id: I2b94a53e21666b16725c4353448d75e916e4f9df Reviewed-on: https://gerrit.libreoffice.org/69252 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/ppt/extdrawingfragmenthandler.cxx6
-rw-r--r--oox/source/ppt/extdrawingfragmenthandler.hxx1
-rw-r--r--oox/source/ppt/pptshapegroupcontext.cxx7
3 files changed, 6 insertions, 8 deletions
diff --git a/oox/source/ppt/extdrawingfragmenthandler.cxx b/oox/source/ppt/extdrawingfragmenthandler.cxx
index a0d40ea0412c..cf8d8e50ed3c 100644
--- a/oox/source/ppt/extdrawingfragmenthandler.cxx
+++ b/oox/source/ppt/extdrawingfragmenthandler.cxx
@@ -29,7 +29,7 @@ ExtDrawingFragmentHandler::ExtDrawingFragmentHandler( XmlFilterBase& rFilter,
mpSlidePersistPtr (rSlidePersistPtr ),
meShapeLocation( eShapeLocation ),
mpGroupShapePtr( pGroupShapePtr ),
- mpOrgShapePtr( pShapePtr )
+ mpShapePtr( pShapePtr )
{
}
@@ -49,10 +49,6 @@ ExtDrawingFragmentHandler::onCreateContext( ::sal_Int32 aElement,
case DSP_TOKEN( drawing ):
break;
case DSP_TOKEN( spTree ):
- mpShapePtr = oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) );
- mpShapePtr->setPosition( mpOrgShapePtr->getPosition() );
- mpShapePtr->setName( mpOrgShapePtr->getName() );
-
return new PPTShapeGroupContext(
*this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr,
mpShapePtr );
diff --git a/oox/source/ppt/extdrawingfragmenthandler.hxx b/oox/source/ppt/extdrawingfragmenthandler.hxx
index 83dfcd216e8f..cdde03777bc1 100644
--- a/oox/source/ppt/extdrawingfragmenthandler.hxx
+++ b/oox/source/ppt/extdrawingfragmenthandler.hxx
@@ -34,7 +34,6 @@ private:
const oox::ppt::SlidePersistPtr mpSlidePersistPtr;
const oox::ppt::ShapeLocation meShapeLocation;
oox::drawingml::ShapePtr const mpGroupShapePtr;
- oox::drawingml::ShapePtr mpOrgShapePtr; // Original Shape data, if any
oox::drawingml::ShapePtr mpShapePtr;
};
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index 199bb790efff..c53b69823c9b 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -71,9 +71,12 @@ ContextHandlerRef PPTShapeGroupContext::onCreateContext( sal_Int32 aElementToken
{
case PPT_TOKEN( cNvPr ):
{
+ // don't override SmartArt properties for embedded drawing's spTree
mpGroupShapePtr->setHidden( rAttribs.getBool( XML_hidden, false ) );
- mpGroupShapePtr->setId( rAttribs.getString( XML_id ).get() );
- mpGroupShapePtr->setName( rAttribs.getString( XML_name ).get() );
+ if (mpGroupShapePtr->getId().isEmpty())
+ mpGroupShapePtr->setId(rAttribs.getString(XML_id).get());
+ if (mpGroupShapePtr->getName().isEmpty())
+ mpGroupShapePtr->setName( rAttribs.getString( XML_name ).get() );
break;
}
case PPT_TOKEN( ph ):