[Libreoffice-commits] core.git: vcl/qa vcl/source

Caolán McNamara caolanm at redhat.com
Mon Jul 13 00:42:31 PDT 2015


 vcl/qa/cppunit/graphicfilter/data/emf/fail/crash-2.emf |binary
 vcl/source/filter/wmf/winmtf.cxx                       |   26 +++++++++--------
 2 files changed, 15 insertions(+), 11 deletions(-)

New commits:
commit 7df4d8544c6b12e31bcb81d9389d03ae7c11bfea
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jul 13 08:33:50 2015 +0100

    emf: test for empty polygons
    
    Change-Id: I3c8896230e3d48a37f4b8d702b0f673e44f45ba4

diff --git a/vcl/qa/cppunit/graphicfilter/data/emf/fail/crash-2.emf b/vcl/qa/cppunit/graphicfilter/data/emf/fail/crash-2.emf
new file mode 100644
index 0000000..6adabec
Binary files /dev/null and b/vcl/qa/cppunit/graphicfilter/data/emf/fail/crash-2.emf differ
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index c770889..f63ebac 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -1294,18 +1294,22 @@ void WinMtfOutput::DrawPolyLine( Polygon& rPolygon, bool bTo, bool bRecordPath )
 {
     UpdateClipRegion();
 
-    ImplMap( rPolygon );
-    if ( bTo )
-    {
-        rPolygon[ 0 ] = maActPos;
-        maActPos = rPolygon[ rPolygon.GetSize() - 1 ];
-    }
-    if ( bRecordPath )
-        aPathObj.AddPolyLine( rPolygon );
-    else
+    sal_uInt16 nPoints = rPolygon.GetSize();
+    if (nPoints >= 1)
     {
-        UpdateLineStyle();
-        mpGDIMetaFile->AddAction( new MetaPolyLineAction( rPolygon, maLineStyle.aLineInfo ) );
+        ImplMap( rPolygon );
+        if ( bTo )
+        {
+            rPolygon[ 0 ] = maActPos;
+            maActPos = rPolygon[ rPolygon.GetSize() - 1 ];
+        }
+        if ( bRecordPath )
+            aPathObj.AddPolyLine( rPolygon );
+        else
+        {
+            UpdateLineStyle();
+            mpGDIMetaFile->AddAction( new MetaPolyLineAction( rPolygon, maLineStyle.aLineInfo ) );
+        }
     }
 }
 


More information about the Libreoffice-commits mailing list