[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/qa vcl/source

Caolán McNamara caolanm at redhat.com
Mon Jul 13 05:45:22 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 1eb5b896c366e270d5a09918b9f857ee90b37ad7
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
    (cherry picked from commit 7df4d8544c6b12e31bcb81d9389d03ae7c11bfea)
    Reviewed-on: https://gerrit.libreoffice.org/16973
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

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 f14f934..20e2b5c 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