summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-13 08:33:50 +0100
committerDavid Tardon <dtardon@redhat.com>2015-07-13 12:45:01 +0000
commit1eb5b896c366e270d5a09918b9f857ee90b37ad7 (patch)
treead7f5c35e964659731a73a711cff32b8610b75c7 /vcl/source
parent31880a0c0123f2062bd39a2d0aa928561fa1fc05 (diff)
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@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/filter/wmf/winmtf.cxx26
1 files changed, 15 insertions, 11 deletions
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index f14f9345ffc7..20e2b5c3a40f 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 ) );
+ }
}
}