diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2021-05-12 19:03:59 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-05-12 22:23:58 +0200 |
commit | 3ffc0afce0f26900a4e1d9feed2c21108e1ed41b (patch) | |
tree | 0ade010130407a553e5a3a6ff1fe120d98b90505 /emfio/source/reader/mtftools.cxx | |
parent | a5041c9102e41f9ec73d991686036eeeff200187 (diff) |
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>
(cherry picked from commit b5ece3fbc7f878846298fd9196e5a30ba50e0dc2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115512
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'emfio/source/reader/mtftools.cxx')
-rw-r--r-- | emfio/source/reader/mtftools.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx index d54e0ff763ae..bdae896a0e4e 100644 --- a/emfio/source/reader/mtftools.cxx +++ b/emfio/source/reader/mtftools.cxx @@ -1304,7 +1304,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++ ) @@ -1390,6 +1391,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 ) |