From 9616b786adb9491f7c26fc0f1053e7b3d1b35f27 Mon Sep 17 00:00:00 2001 From: Vort Date: Wed, 12 Feb 2014 12:35:26 +0200 Subject: fdo#45003 PDF import: Implementing linejoin and linecap properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4b09cd7b970d5aca4500ae333edef0e4c2f618b9 Reviewed-on: https://gerrit.libreoffice.org/8009 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sdext/source/pdfimport/tree/drawtreevisiting.cxx | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx index e3b013502f0d..bd44686270ac 100644 --- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx +++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx @@ -35,6 +35,8 @@ #include "comphelper/processfactory.hxx" #include "com/sun/star/i18n/ScriptType.hpp" #include "com/sun/star/i18n/DirectionProperty.hpp" +#include "com/sun/star/rendering/PathCapType.hpp" +#include "com/sun/star/rendering/PathJoinType.hpp" #include @@ -793,6 +795,36 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const std::list< Element* > aGCProps[ "svg:stroke-width" ] = OUString::number( aVec.getLength() ); } + OUString strokeLinejoinValue; + OUString strokeLinecapValue; + switch (rGC.LineJoin) + { + default: + case rendering::PathJoinType::MITER: + strokeLinejoinValue = "miter"; + break; + case rendering::PathJoinType::ROUND: + strokeLinejoinValue = "round"; + break; + case rendering::PathJoinType::BEVEL: + strokeLinejoinValue = "bevel"; + break; + } + switch (rGC.LineCap) + { + default: + case rendering::PathCapType::BUTT: + strokeLinecapValue = "butt"; + break; + case rendering::PathCapType::ROUND: + strokeLinecapValue = "round"; + break; + case rendering::PathCapType::SQUARE: + strokeLinecapValue = "square"; + break; + } + aGCProps[ "draw:stroke-linejoin" ] = strokeLinejoinValue; + aGCProps[ "svg:stroke-linecap" ] = strokeLinecapValue; } else { -- cgit v1.2.3