diff options
author | László Németh <nemeth@numbertext.org> | 2013-11-01 20:41:51 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2013-11-01 20:41:51 +0100 |
commit | a2b59a51274ccf29ce1bd77a9330c6e3136fc590 (patch) | |
tree | 1a59c833748b75aac135e46e89c1b5fdfb65bb6f | |
parent | 46bcd543406a144c221a8055d3efeab94c08c6fc (diff) |
fdo#71137 fix linecap and linejoint in SVG export
Change-Id: I52ee0ec79ebcd5a32f0c328440ce46e0452b121e
-rw-r--r-- | filter/source/svg/svgwriter.cxx | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 3cb1ee70b61d..22b8c61f3c23 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -1861,7 +1861,51 @@ void SVGActionWriter::ImplAddLineAttr( const LineInfo &rAttrs, sal_Int32 nStrokeWidth = bApplyMapping ? ImplMap( rAttrs.GetWidth() ) : rAttrs.GetWidth(); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStrokeWidth, OUString::number( nStrokeWidth ) ); + // support for LineJoint + switch(rAttrs.GetLineJoin()) + { + default: // B2DLINEJOIN_NONE, B2DLINEJOIN_MIDDLE + case basegfx::B2DLINEJOIN_MITER: + { + mrExport.AddAttribute(XML_NAMESPACE_NONE, aXMLAttrStrokeLinejoin, "miter"); + break; + } + case basegfx::B2DLINEJOIN_BEVEL: + { + mrExport.AddAttribute(XML_NAMESPACE_NONE, aXMLAttrStrokeLinejoin, "bevel"); + break; + } + case basegfx::B2DLINEJOIN_ROUND: + { + mrExport.AddAttribute(XML_NAMESPACE_NONE, aXMLAttrStrokeLinejoin, "round"); + break; + } + } + + // support for LineCap + switch(rAttrs.GetLineCap()) + { + default: /* com::sun::star::drawing::LineCap_BUTT */ + { + // butt is Svg default, so no need to write until the exporter might write styles. + // If this happens, activate here + // mrExport.AddAttribute(XML_NAMESPACE_NONE, aXMLAttrStrokeLinecap, "butt"); + break; + } + case com::sun::star::drawing::LineCap_ROUND: + { + mrExport.AddAttribute(XML_NAMESPACE_NONE, aXMLAttrStrokeLinecap, "round"); + break; + } + case com::sun::star::drawing::LineCap_SQUARE: + { + mrExport.AddAttribute(XML_NAMESPACE_NONE, aXMLAttrStrokeLinecap, "square"); + break; + } } + + } + } void SVGActionWriter::ImplWritePolyPolygon( const PolyPolygon& rPolyPoly, sal_Bool bLineOnly, |