path: root/oox/inc/oox/vml/vmlshape.hxx
diff options
authorEilidh McAdam <>2012-09-19 10:01:57 +0100
committerMiklos Vajna <>2012-09-19 14:04:21 +0000
commit0423a6741fc08a35b123556f9b10219d090ee42a (patch)
treead7f4b50ddd951f65cd7a79ba4d39a719982998f /oox/inc/oox/vml/vmlshape.hxx
parent891746ed955b110960113ba0de3a51335af50d66 (diff)
Import bezier curves from .docx.
A shape element with a path attribute is interpreted as a bezier. We can support both curve and line commands by using the correct co-ordinate flags when using the UNO interface (omit control points for lines). Alternatively, curves may be specified using the to, from, control1 and control2 attributes of a curve element. Note that when setting the PolyPolygonBezier property of the xshape, the shape size and position are set too large somehow. The workaround for now is manually forcing the pre-calculated shape size and position. Change-Id: If3563474df357d161a2ed2e7a20856d5aed80a94 Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Miklos Vajna <>
Diffstat (limited to 'oox/inc/oox/vml/vmlshape.hxx')
1 files changed, 19 insertions, 0 deletions
diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index 8fab5f7ec92d..5bdc2b51e486 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -185,6 +185,9 @@ struct ShapeModel
::rtl::OUString maLegacyDiagramPath;///< Legacy Diagram Fragment Path
::rtl::OUString maFrom; ///< Start point for line shape.
::rtl::OUString maTo; ///< End point for line shape.
+ ::rtl::OUString maControl1; ///< Bezier control point 1
+ ::rtl::OUString maControl2; ///< Bezier control point 2
+ ::rtl::OUString maVmlPath; ///< VML path for this shape
explicit ShapeModel();
@@ -334,6 +337,22 @@ protected:
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+/** Bezier shape object that supports to, from, control1 and control2
+ attribute or path attribute specification */
+class BezierShape : public SimpleShape
+ explicit BezierShape( Drawing& rDrawing );
+ /** Creates the corresponding XShape and inserts it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
// ============================================================================
/** A shape object with custom geometry. */