Module: wine Branch: master Commit: 751d93c55fb959d2f181ba568a1810d327c456c4 URL: https://gitlab.winehq.org/wine/wine/-/commit/751d93c55fb959d2f181ba568a1810d...
Author: Piotr Caban piotr@codeweavers.com Date: Sun Mar 26 12:08:22 2023 +0200
wineps: Handle EMR_POLYLINETO record in spool files.
---
dlls/wineps.drv/printproc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 67099365032..2b7ffaa5e4c 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -172,6 +172,24 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, return PSDRV_PolyBezierTo(&data->pdev->dev, (const POINT *)p->aptl, p->cptl) && MoveToEx(data->pdev->dev.hdc, p->aptl[p->cptl - 1].x, p->aptl[p->cptl - 1].y, NULL); } + case EMR_POLYLINETO: + { + const EMRPOLYLINETO *p = (const EMRPOLYLINETO *)rec; + POINT *pts; + DWORD cnt; + int ret; + + cnt = p->cptl + 1; + pts = malloc(sizeof(*pts) * cnt); + if (!pts) return 0; + + GetCurrentPositionEx(data->pdev->dev.hdc, pts); + memcpy(pts + 1, p->aptl, sizeof(*pts) * p->cptl); + ret = PSDRV_PolyPolyline(&data->pdev->dev, pts, &cnt, 1) && + MoveToEx(data->pdev->dev.hdc, pts[cnt - 1].x, pts[cnt - 1].y, NULL); + free(pts); + return ret; + } case EMR_POLYPOLYLINE: { const EMRPOLYPOLYLINE *p = (const EMRPOLYPOLYLINE *)rec;