summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-12-12 14:32:39 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-12-12 14:37:11 +0100
commitdbdc31fc0a09181d80909819d93a2dacde3eac79 (patch)
tree20cb1ee9cc96ad163f4eb6ba2cfe1ce5d5dbba8a /oox/source
parent10c3c9ec9b6af1b4124ff2cd458d22f13f4ebc39 (diff)
oox: initial ShapeExport::WriteGroupShape
For now, enable it only for DOCX. Change-Id: I424d8fb3f1c1e7c9a03e7103c91473c3ff85bc77
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/export/shapes.cxx27
1 files changed, 24 insertions, 3 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 5689215e4fd1..e2e7a13e6d55 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -243,6 +243,25 @@ ShapeExport& ShapeExport::WriteOpenBezierShape( Reference< XShape > xShape )
return WriteBezierShape( xShape, sal_False );
}
+ShapeExport& ShapeExport::WriteGroupShape(uno::Reference<drawing::XShape> xShape)
+{
+ FSHelperPtr pFS = GetFS();
+ pFS->startElementNS(mnXmlNamespace, XML_wgp, FSEND);
+
+ // non visual properties
+ pFS->singleElementNS(mnXmlNamespace, XML_cNvGrpSpPr, FSEND);
+
+ // visual properties
+ pFS->startElementNS(mnXmlNamespace, XML_grpSpPr, FSEND);
+ WriteShapeTransformation(xShape, XML_a);
+ pFS->endElementNS(mnXmlNamespace, XML_grpSpPr);
+
+ // TODO: children
+
+ pFS->endElementNS(mnXmlNamespace, XML_wgp);
+ return *this;
+}
+
ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape )
{
DBG(printf("write custom shape\n"));
@@ -679,7 +698,7 @@ ShapeExport& ShapeExport::WriteRectangleShape( Reference< XShape > xShape )
typedef ShapeExport& (ShapeExport::*ShapeConverter)( Reference< XShape > );
typedef boost::unordered_map< const char*, ShapeConverter, rtl::CStringHash, rtl::CStringEqual> NameToConvertMapType;
-static const NameToConvertMapType& lcl_GetConverters()
+static const NameToConvertMapType& lcl_GetConverters(DrawingML::DocumentType eDocumentType)
{
static bool shape_map_inited = false;
static NameToConvertMapType shape_converters;
@@ -712,6 +731,8 @@ static const NameToConvertMapType& lcl_GetConverters()
shape_converters[ "com.sun.star.presentation.OutlinerShape" ] = &ShapeExport::WriteTextShape;
shape_converters[ "com.sun.star.presentation.SlideNumberShape" ] = &ShapeExport::WriteTextShape;
shape_converters[ "com.sun.star.presentation.TitleTextShape" ] = &ShapeExport::WriteTextShape;
+ if (eDocumentType == DrawingML::DOCUMENT_DOCX)
+ shape_converters[ "com.sun.star.drawing.GroupShape" ] = &ShapeExport::WriteGroupShape;
shape_map_inited = true;
return shape_converters;
@@ -721,8 +742,8 @@ ShapeExport& ShapeExport::WriteShape( Reference< XShape > xShape )
{
OUString sShapeType = xShape->getShapeType();
DBG( printf( "write shape: %s\n", USS( sShapeType ) ) );
- NameToConvertMapType::const_iterator aConverter = lcl_GetConverters().find( USS( sShapeType ) );
- if( aConverter == lcl_GetConverters().end() )
+ NameToConvertMapType::const_iterator aConverter = lcl_GetConverters(GetDocumentType()).find( USS( sShapeType ) );
+ if( aConverter == lcl_GetConverters(GetDocumentType()).end() )
{
DBG( printf( "unknown shape\n" ) );
return WriteUnknownShape( xShape );