filter/source/svg/svgwriter.cxx |   44 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

New commits:
commit a2b59a51274ccf29ce1bd77a9330c6e3136fc590
Author: László Németh <nem...@numbertext.org>
Date:   Fri Nov 1 20:41:51 2013 +0100

    fdo#71137 fix linecap and linejoint in SVG export
    
    Change-Id: I52ee0ec79ebcd5a32f0c328440ce46e0452b121e

diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 3cb1ee7..22b8c61 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,
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to