[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

Andras Timar andras.timar at collabora.com
Mon Jan 6 10:29:37 PST 2014


 vcl/source/filter/wmf/enhwmf.cxx |   28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

New commits:
commit 356a5921f0a0a2295d55cbee2bf1570f357bd686
Author: Andras Timar <andras.timar at collabora.com>
Date:   Mon Jan 6 19:23:01 2014 +0100

    EMF/WMF: parse line cap and line join
    
    Change-Id: I081ae9c24e48912631dcfe4aba8a06ff2680aaf5

diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index 3ad4481..5cd9c0b 100644
--- a/vcl/source/filter/wmf/enhwmf.cxx
+++ b/vcl/source/filter/wmf/enhwmf.cxx
@@ -732,7 +732,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
                         sal_Bool bTransparent = sal_False;
                         sal_uInt16 nDashCount = 0;
                         sal_uInt16 nDotCount = 0;
-                        switch( nStyle )
+                        switch( nStyle & 0xFF )
                         {
                             case PS_DASHDOTDOT :
                                 nDotCount++;
@@ -753,6 +753,32 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
                             case PS_SOLID :
                                 aLineInfo.SetStyle( LINE_SOLID );
                         }
+                        switch( nStyle & 0xF00 )
+                        {
+                            case PS_ENDCAP_ROUND :
+                                aLineInfo.SetLineCap( com::sun::star::drawing::LineCap_ROUND );
+                            break;
+                            case PS_ENDCAP_SQUARE :
+                                aLineInfo.SetLineCap( com::sun::star::drawing::LineCap_SQUARE );
+                            break;
+                            case PS_ENDCAP_FLAT :
+                            default :
+                                aLineInfo.SetLineCap( com::sun::star::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 );
+                        }
                         if ( nDashCount | nDotCount )
                         {
                             aLineInfo.SetStyle( LINE_DASH );


More information about the Libreoffice-commits mailing list