Commit 9a96ac0d authored by Alexander Nicolaysen Sørnes's avatar Alexander Nicolaysen Sørnes Committed by Alexandre Julliard

comdlg32: PageSetupDlgW: Set orientation in printer dialog.

parent 63c5e152
......@@ -2701,6 +2701,23 @@ static void PRINTDLG_PS_SetOrientationW(HWND hDlg, PageSetupDataW* pda)
}
}
static void PRINTDLG_PS_UpdatePrintDlgW(PageSetupDataW* pda)
{
DEVMODEW* dm;
dm = GlobalLock(pda->pdlg.hDevMode);
if(!dm)
return;
if(pda->curdlg.ptPaperSize.y > pda->curdlg.ptPaperSize.x)
dm->u1.s1.dmOrientation = DMORIENT_PORTRAIT;
else
dm->u1.s1.dmOrientation = DMORIENT_LANDSCAPE;
GlobalUnlock(pda->pdlg.hDevMode);
}
static BOOL
PRINTDLG_PS_ChangePrinterW(HWND hDlg, PageSetupDataW *pda) {
DEVNAMES *dn;
......@@ -2985,6 +3002,7 @@ PRINTDLG_PS_WMCommandW(
case psh3: {
pda->pdlg.Flags = 0;
pda->pdlg.hwndOwner = hDlg;
PRINTDLG_PS_UpdatePrintDlgW(pda);
if (PrintDlgW(&(pda->pdlg)))
PRINTDLG_PS_ChangePrinterW(hDlg,pda);
return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment