summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-12-13 15:01:35 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-12-13 15:11:20 +0100
commit445d3d8484d6e480f461de305c9dc4def067cf20 (patch)
tree8000dfb2d21dc7b11d2982a66094a06649e7d90e /oox
parentd1e1cd128c83982f69331c92a8e319d3031a7685 (diff)
drawingml export: handle child shapes when exporting groupshapes
Change-Id: I4ed800ad17750c87788108417c8a7b1817853115
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx7
-rw-r--r--oox/source/export/shapes.cxx13
2 files changed, 19 insertions, 1 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 3ed8f02afe74..0e8db872c7e3 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -670,6 +670,13 @@ void DrawingML::WriteShapeTransformation( Reference< XShape > rXShape, sal_Int32
awt::Point aPos = rXShape->getPosition();
awt::Size aSize = rXShape->getSize();
+ if (m_xParent.is())
+ {
+ awt::Point aParentPos = m_xParent->getPosition();
+ aPos.X -= aParentPos.X;
+ aPos.Y -= aParentPos.Y;
+ }
+
if ( aSize.Width < 0 )
aSize.Width = 1000;
if ( aSize.Height < 0 )
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index e2e7a13e6d55..3e9a08242f48 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -256,7 +256,18 @@ ShapeExport& ShapeExport::WriteGroupShape(uno::Reference<drawing::XShape> xShape
WriteShapeTransformation(xShape, XML_a);
pFS->endElementNS(mnXmlNamespace, XML_grpSpPr);
- // TODO: children
+ uno::Reference<drawing::XShapes> xGroupShape(xShape, uno::UNO_QUERY_THROW);
+ uno::Reference<drawing::XShape> xParent = m_xParent;
+ m_xParent = xShape;
+ for (sal_Int32 i = 0; i < xGroupShape->getCount(); ++i)
+ {
+ uno::Reference<drawing::XShape> xChild(xGroupShape->getByIndex(i), uno::UNO_QUERY_THROW);
+ sal_Int32 nSavedNamespace = mnXmlNamespace;
+ mnXmlNamespace = XML_wps;
+ WriteShape(xChild);
+ mnXmlNamespace = nSavedNamespace;
+ }
+ m_xParent = xParent;
pFS->endElementNS(mnXmlNamespace, XML_wgp);
return *this;