diff options
author | Noel Power <noel.power@suse.com> | 2012-08-15 13:03:04 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2012-08-15 13:04:52 +0100 |
commit | 541986fef0993d749cc7ed790eacace322f43bb0 (patch) | |
tree | e72ae3ca60c70ec2e25f55c102c9417214d76b65 /sc | |
parent | f25b78bd99a1eb0d81ce9993f514d0a625aaa776 (diff) |
fix for fdo#53229, import group shapes position and size correctly
Change-Id: Ie513b4a6351a2c6458eeca208faf7ba5bbb9fcce
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/XMLTableShapeImportHelper.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx index 1b58d21bd153..5bc2553fd969 100644 --- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx +++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx @@ -192,6 +192,26 @@ void XMLTableShapeImportHelper::finishShape( } else //this are grouped shapes which should also get the layerid { + if ( !bOnTable ) + { + // For cell anchored grouped shape we need to set the start + // position from the most top left positioned shape within + // the group + Point aStartPoint( rShape->getPosition().X,rShape->getPosition().Y ); + awt::Size aSize(rShape->getSize() ); + if (SvxShape* pGroupShapeImp = SvxShape::getImplementation(rShapes)) + { + if (SdrObject *pSdrObj = pGroupShapeImp->GetSdrObject()) + { + if ( ScDrawObjData* pAnchor = ScDrawLayer::GetObjData( pSdrObj ) ) + { + if ( ( pAnchor->maStartOffset.getX() == 0 && pAnchor->maStartOffset.getY() == 0 ) + || ( aStartPoint.IsAbove( pAnchor->maStartOffset ) && aStartPoint.IsLeft( pAnchor->maStartOffset ) ) ) + pAnchor->maStartOffset = aStartPoint; + } + } + } + } sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0); sal_Int16 nLayerID(-1); for( sal_Int16 i=0; i < nAttrCount; ++i ) |