From 9a96ac0dcc59d265ce7ce2e896551c84a937e09e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Sun, 6 Jan 2008 14:06:23 +0100 Subject: [PATCH] comdlg32: PageSetupDlgW: Set orientation in printer dialog. --- dlls/comdlg32/printdlg.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c index 6b8ed15aaa1..8439c31d87d 100644 --- a/dlls/comdlg32/printdlg.c +++ b/dlls/comdlg32/printdlg.c @@ -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;