diff options
-rw-r--r-- | include/oox/export/shapes.hxx | 2 | ||||
-rw-r--r-- | oox/source/export/shapes.cxx | 27 |
2 files changed, 26 insertions, 3 deletions
diff --git a/include/oox/export/shapes.hxx b/include/oox/export/shapes.hxx index 65fafc9d18f7..bfcaaf713113 100644 --- a/include/oox/export/shapes.hxx +++ b/include/oox/export/shapes.hxx @@ -94,6 +94,8 @@ public: virtual ShapeExport& WriteGraphicObjectShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ); virtual ShapeExport& + WriteGroupShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ); + virtual ShapeExport& WriteLineShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ); virtual ShapeExport& WriteNonVisualDrawingProperties( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape, const char* sName ); 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 ); |