diff options
author | Andras Timar <andras.timar@collabora.com> | 2014-01-19 15:12:15 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-01-19 18:00:26 +0100 |
commit | 09c722873b2d378d2d155f5f1dd7d8f3fb2012e9 (patch) | |
tree | f0ae54ea755b74a0292183150181d68f0f5c4ca5 /vcl/source/filter/wmf/winwmf.cxx | |
parent | 31507aaceb86a6dd153f64cc773c241eb03ed6a7 (diff) |
EMF/WMF: fix rendering of pen styles (dash, dot, dashdot, dashdotdot)
Change-Id: I226bac370601b75f2589f7a7c5e8830746b31e2e
Diffstat (limited to 'vcl/source/filter/wmf/winwmf.cxx')
-rw-r--r-- | vcl/source/filter/wmf/winwmf.cxx | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index 3a10fb2feb37..378dc3c8bf00 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -749,19 +749,37 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) aLineInfo.SetWidth( nWidth ); sal_Bool bTransparent = sal_False; - sal_uInt16 nDashCount = 0; - sal_uInt16 nDotCount = 0; switch( nStyle & 0xFF ) { case PS_DASHDOTDOT : - nDotCount++; + aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetDashCount( 1 ); + aLineInfo.SetDotCount( 2 ); + aLineInfo.SetDashLen( 150 ); + aLineInfo.SetDotLen( 30 ); + aLineInfo.SetDistance( 50 ); + break; case PS_DASHDOT : - nDashCount++; + aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetDashCount( 1 ); + aLineInfo.SetDotCount( 1 ); + aLineInfo.SetDashLen( 150 ); + aLineInfo.SetDotLen( 30 ); + aLineInfo.SetDistance( 90 ); + break; case PS_DOT : - nDotCount++; + aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetDashCount( 0 ); + aLineInfo.SetDotCount( 1 ); + aLineInfo.SetDotLen( 30 ); + aLineInfo.SetDistance( 50 ); break; case PS_DASH : - nDashCount++; + aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetDashCount( 1 ); + aLineInfo.SetDotCount( 0 ); + aLineInfo.SetDashLen( 225 ); + aLineInfo.SetDistance( 100 ); break; case PS_NULL : bTransparent = sal_True; @@ -798,12 +816,6 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) default : aLineInfo.SetLineJoin ( basegfx::B2DLINEJOIN_NONE ); } - if ( nDashCount | nDotCount ) - { - aLineInfo.SetStyle( LINE_DASH ); - aLineInfo.SetDashCount( nDashCount ); - aLineInfo.SetDotCount( nDotCount ); - } pOut->CreateObject( GDI_PEN, new WinMtfLineStyle( ReadColor(), aLineInfo, bTransparent ) ); } break; |