Alexander Nicolaysen Sørnes : comdlg32: PageSetupDlgW: Set orientation in printer dialog.

Alexandre Julliard julliard at winehq.org
Mon Jan 7 08:39:28 CST 2008


Module: wine
Branch: master
Commit: 9a96ac0dcc59d265ce7ce2e896551c84a937e09e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9a96ac0dcc59d265ce7ce2e896551c84a937e09e

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Sun Jan  6 14:06:23 2008 +0100

comdlg32: PageSetupDlgW: Set orientation in printer dialog.

---

 dlls/comdlg32/printdlg.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c
index 6b8ed15..8439c31 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;




More information about the wine-cvs mailing list