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-05-21 09:29:50 +0200
commitf8586c223f07ddff4bba5d5c694cee33ac811412 (patch)
tree6aabc6fe9e84fbcfd2d6b11364dae5f39e80b22e /oox
parent3807fb7c541632a4d21afba88c27865957036f0a (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> Reviewed-on: https://gerrit.libreoffice.org/72472
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 1180af3f10fb..9a775655518f 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 ):