summaryrefslogtreecommitdiff
path: root/emfio/source
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2021-05-12 19:03:59 +0200
committerBartosz Kosiorek <gang65@poczta.onet.pl>2021-05-12 20:32:27 +0200
commitb5ece3fbc7f878846298fd9196e5a30ba50e0dc2 (patch)
tree47dada95fcb61623d3a3299caf29398d476b3e3e /emfio/source
parent145b2d8ee131dca592a41f7b26341a542a23845b (diff)
tdf#112603 tdf#142014 tdf#142139 WMF/EMF Fix line width
Previosly line width was always 1, and changing width do not affect line. Change-Id: I462096b915e053fa089e85860f124466b650558a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115497 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'emfio/source')
-rw-r--r--emfio/source/reader/mtftools.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index 2b1c1d406d1b..2d9fe3601ebd 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -1322,7 +1322,8 @@ namespace emfio
if ( !bStroke )
mpGDIMetaFile->AddAction( new MetaPopAction() );
}
- else
+ // tdf#142014 By default the stroke is made with hairline. If width is bigger, we need to use PolyLineAction
+ if ( bStroke && ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LineStyle::Dash ) ) )
{
sal_uInt16 i, nCount = maPathObj.Count();
for ( i = 0; i < nCount; i++ )
@@ -1408,6 +1409,13 @@ namespace emfio
UpdateLineStyle();
UpdateFillStyle();
mpGDIMetaFile->AddAction( new MetaRoundRectAction( ImplMap( rRect ), std::abs( ImplMap( rSize ).Width() ), std::abs( ImplMap( rSize ).Height() ) ) );
+ // tdf#142139 Wrong line width during WMF import
+ if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LineStyle::Dash ) )
+ {
+ tools::Polygon aRoundRectPoly( rRect, rSize.Width(), rSize.Height() );
+ aRoundRectPoly.Optimize( PolyOptimizeFlags::EDGES );
+ mpGDIMetaFile->AddAction( new MetaPolyLineAction( ImplMap( aRoundRectPoly ), maLineStyle.aLineInfo ) );
+ }
}
void MtfTools::DrawEllipse( const tools::Rectangle& rRect )