summaryrefslogtreecommitdiff
path: root/emfio/source/reader/wmfreader.cxx
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2022-04-29 13:36:10 +0200
committerBartosz Kosiorek <gang65@poczta.onet.pl>2022-05-09 11:08:25 +0200
commit32cb4e4fe55e662d2e515e9a6facabffe3684754 (patch)
treefbd036a53ad0e9011957c728b969c6f1dd811a2d /emfio/source/reader/wmfreader.cxx
parentd4ec15d5b7c64cd62b6f729c1334c167da5886b4 (diff)
tdf#89331 EMF/WMF Fix holes in lines created with LINETO
If the lines are created with MOVETO, LINETO, LINETO... then Line Join NONE is applied. As a result the charts are looks ugly, with the holes inside it. For example: https://bugs.documentfoundation.org/attachment.cgi?id=179962 and https://bugs.documentfoundation.org/attachment.cgi?id=179837 Additinally commit changed default line join style to miter, as during experimenting with MS Paint and MS Word, it appear that default Join Style is PS_JOIN_MITER and Line Cap is Flat/Butter. The PDF export tests has been updated, as there is less number of PDF object after using joiners. The size of the exported tdf145873.pptx to PDF, was slighltly decreased from 22.8kB to 22.0KB Change-Id: I131cc3c5e90f827d67d2360eb18167eed6315abb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133624 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'emfio/source/reader/wmfreader.cxx')
-rw-r--r--emfio/source/reader/wmfreader.cxx65
1 files changed, 1 insertions, 64 deletions
diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx
index 44615556793f..5f6eeed66757 100644
--- a/emfio/source/reader/wmfreader.cxx
+++ b/emfio/source/reader/wmfreader.cxx
@@ -1025,70 +1025,7 @@ namespace emfio
mpInputStream->ReadUInt16(nStyle);
mpInputStream->ReadUInt16(nWidth);
mpInputStream->ReadUInt16(nHeight);
-
- if (nWidth > 0)
- aLineInfo.SetWidth(nWidth);
-
- bool bTransparent = false;
-
- switch( nStyle & 0xFF )
- {
- case PS_DASHDOTDOT :
- aLineInfo.SetStyle( LineStyle::Dash );
- aLineInfo.SetDashCount( 1 );
- aLineInfo.SetDotCount( 2 );
- break;
- case PS_DASHDOT :
- aLineInfo.SetStyle( LineStyle::Dash );
- aLineInfo.SetDashCount( 1 );
- aLineInfo.SetDotCount( 1 );
- break;
- case PS_DOT :
- aLineInfo.SetStyle( LineStyle::Dash );
- aLineInfo.SetDashCount( 0 );
- aLineInfo.SetDotCount( 1 );
- break;
- case PS_DASH :
- aLineInfo.SetStyle( LineStyle::Dash );
- aLineInfo.SetDashCount( 1 );
- aLineInfo.SetDotCount( 0 );
- break;
- case PS_NULL :
- bTransparent = true;
- aLineInfo.SetStyle( LineStyle::NONE );
- break;
- default :
- case PS_INSIDEFRAME :
- case PS_SOLID :
- aLineInfo.SetStyle( LineStyle::Solid );
- }
- switch( nStyle & 0xF00 )
- {
- case PS_ENDCAP_ROUND :
- aLineInfo.SetLineCap( css::drawing::LineCap_ROUND );
- break;
- case PS_ENDCAP_SQUARE :
- aLineInfo.SetLineCap( css::drawing::LineCap_SQUARE );
- break;
- case PS_ENDCAP_FLAT :
- default :
- aLineInfo.SetLineCap( css::drawing::LineCap_BUTT );
- }
- switch( nStyle & 0xF000 )
- {
- case PS_JOIN_ROUND :
- aLineInfo.SetLineJoin ( basegfx::B2DLineJoin::Round );
- break;
- case PS_JOIN_MITER :
- aLineInfo.SetLineJoin ( basegfx::B2DLineJoin::Miter );
- break;
- case PS_JOIN_BEVEL :
- aLineInfo.SetLineJoin ( basegfx::B2DLineJoin::Bevel );
- break;
- default :
- aLineInfo.SetLineJoin ( basegfx::B2DLineJoin::NONE );
- }
- CreateObject(std::make_unique<WinMtfLineStyle>( ReadColor(), aLineInfo, bTransparent ));
+ CreateObject(std::make_unique<WinMtfLineStyle>(ReadColor(), nStyle, nWidth));
}
break;