X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/51b62c2431bfbe54e92bb42241018fe4d6232834..60848fcfefa649f4e1275281639881452374a350:/src/generic/dcpsg.cpp diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index 598e845d9c..d7477c3892 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -613,7 +613,7 @@ void wxPostScriptDC::DoDrawPolygon (int n, wxPoint points[], wxCoord xoffset, wx } } -void wxPostScriptDC::DoDrawPolyPolygon (int n, int start[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle) +void wxPostScriptDC::DoDrawPolyPolygon (int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle) { wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); @@ -626,7 +626,7 @@ void wxPostScriptDC::DoDrawPolyPolygon (int n, int start[], wxPoint points[], wx PsPrint( "newpath\n" ); int ofs = 0; - for (int i = 0; i < n; ofs += start[i++]) + for (int i = 0; i < n; ofs += count[i++]) { wxCoord xx = LogicalToDeviceX(points[ofs].x + xoffset); wxCoord yy = LogicalToDeviceY(points[ofs].y + yoffset); @@ -635,7 +635,7 @@ void wxPostScriptDC::DoDrawPolyPolygon (int n, int start[], wxPoint points[], wx CalcBoundingBox( points[ofs].x + xoffset, points[ofs].y + yoffset ); - for (int j = 1; j < start[i]; j++) + for (int j = 1; j < count[i]; j++) { xx = LogicalToDeviceX(points[ofs+j].x + xoffset); yy = LogicalToDeviceY(points[ofs+j].y + yoffset); @@ -655,7 +655,7 @@ void wxPostScriptDC::DoDrawPolyPolygon (int n, int start[], wxPoint points[], wx PsPrint( "newpath\n" ); int ofs = 0; - for (int i = 0; i < n; ofs += start[i++]) + for (int i = 0; i < n; ofs += count[i++]) { wxCoord xx = LogicalToDeviceX(points[ofs].x + xoffset); wxCoord yy = LogicalToDeviceY(points[ofs].y + yoffset); @@ -664,7 +664,7 @@ void wxPostScriptDC::DoDrawPolyPolygon (int n, int start[], wxPoint points[], wx CalcBoundingBox( points[ofs].x + xoffset, points[ofs].y + yoffset ); - for (int j = 1; j < start[i]; j++) + for (int j = 1; j < count[i]; j++) { xx = LogicalToDeviceX(points[ofs+j].x + xoffset); yy = LogicalToDeviceY(points[ofs+j].y + yoffset); @@ -1011,6 +1011,10 @@ void wxPostScriptDC::SetFont( const wxFont& font ) } } + // We may legitimately call SetFont before BeginDoc + if (!m_pstream) + return; + PsPrint( name ); PsPrint( " reencodeISO def\n" ); PsPrint( name );