forked from Mirrors/wine-wine
comdlg32: PageSetupDlgW: Set orientation in printer dialog.
parent
63c5e152a1
commit
9a96ac0dcc
|
@ -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
|
static BOOL
|
||||||
PRINTDLG_PS_ChangePrinterW(HWND hDlg, PageSetupDataW *pda) {
|
PRINTDLG_PS_ChangePrinterW(HWND hDlg, PageSetupDataW *pda) {
|
||||||
DEVNAMES *dn;
|
DEVNAMES *dn;
|
||||||
|
@ -2985,6 +3002,7 @@ PRINTDLG_PS_WMCommandW(
|
||||||
case psh3: {
|
case psh3: {
|
||||||
pda->pdlg.Flags = 0;
|
pda->pdlg.Flags = 0;
|
||||||
pda->pdlg.hwndOwner = hDlg;
|
pda->pdlg.hwndOwner = hDlg;
|
||||||
|
PRINTDLG_PS_UpdatePrintDlgW(pda);
|
||||||
if (PrintDlgW(&(pda->pdlg)))
|
if (PrintDlgW(&(pda->pdlg)))
|
||||||
PRINTDLG_PS_ChangePrinterW(hDlg,pda);
|
PRINTDLG_PS_ChangePrinterW(hDlg,pda);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in New Issue