From 95d98d0bfc1fbf8d3d24dc235d60fcdf3228c201 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Tue, 25 Dec 2012 12:18:33 +0800 Subject: [PATCH] wineps.drv: Update dmPaperWidth/Height when dmPaperSize is being changed through UI. --- dlls/wineps.drv/driver.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/wineps.drv/driver.c b/dlls/wineps.drv/driver.c index c1e49d7d2c0..8ec51a29054 100644 --- a/dlls/wineps.drv/driver.c +++ b/dlls/wineps.drv/driver.c @@ -340,10 +340,15 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg, if(i >= Cursel) break; i++; } - TRACE("Setting pagesize to item %d Winpage = %d\n", Cursel, ps->WinPage); + TRACE("Setting pagesize to item %d, WinPage %d (%s), PaperSize %.2fx%.2f\n", Cursel, + ps->WinPage, ps->FullName, ps->PaperDimension->x, ps->PaperDimension->y); di->dlgdm->dmPublic.u1.s1.dmPaperSize = ps->WinPage; di->dlgdm->dmPublic.dmFields |= DM_PAPERSIZE; + di->dlgdm->dmPublic.u1.s1.dmPaperWidth = paper_size_from_points(ps->PaperDimension->x); + di->dlgdm->dmPublic.u1.s1.dmPaperLength = paper_size_from_points(ps->PaperDimension->y); + di->dlgdm->dmPublic.dmFields |= DM_PAPERLENGTH | DM_PAPERWIDTH; + if (di->dlgdm->dmPublic.dmSize >= FIELD_OFFSET(DEVMODEW, dmFormName) + CCHFORMNAME * sizeof(WCHAR)) { MultiByteToWideChar(CP_ACP, 0, ps->FullName, -1, di->dlgdm->dmPublic.dmFormName, CCHFORMNAME);