comdlg32: PageSetupDlgW: Set orientation in printer dialog.

oldstable
Alexander Nicolaysen Sørnes 2008-01-06 14:06:23 +01:00 committed by Alexandre Julliard
parent 63c5e152a1
commit 9a96ac0dcc
1 changed files with 18 additions and 0 deletions

View File

@ -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;