2 ===================================================================
3 --- printdlg.c (revision 23123)
4 +++ printdlg.c (working copy)
7 (IsDlgButtonChecked(hDlg, chx2) == BST_CHECKED);
8 if (lpdm->dmFields & DM_COPIES)
9 - lpdm->dmCopies = GetDlgItemInt(hDlg, edt3, NULL, FALSE);
10 + lpdm->u.s.dmCopies = GetDlgItemInt(hDlg, edt3, NULL, FALSE);
12 if (IsDlgButtonChecked(hDlg, chx2) == BST_CHECKED)
13 lppd->Flags |= PD_COLLATE;
16 (IsDlgButtonChecked(hDlg, chx2) == BST_CHECKED);
17 if (lpdm->dmFields & DM_COPIES)
18 - lpdm->dmCopies = GetDlgItemInt(hDlg, edt3, NULL, FALSE);
19 + lpdm->u.s.dmCopies = GetDlgItemInt(hDlg, edt3, NULL, FALSE);
21 if (IsDlgButtonChecked(hDlg, chx2) == BST_CHECKED)
22 lppd->Flags |= PD_COLLATE;
26 if (nIDComboBox == cmb2)
27 - dm->u1.s1.dmPaperSize = oldWord;
28 + dm->u.s.dmPaperSize = oldWord;
30 - dm->dmDefaultSource = oldWord;
31 + dm->u.s.dmDefaultSource = oldWord;
38 if (nIDComboBox == cmb2)
39 - oldWord = dm->u1.s1.dmPaperSize;
40 + oldWord = dm->u.s.dmPaperSize;
42 - oldWord = dm->dmDefaultSource;
43 + oldWord = dm->u.s.dmDefaultSource;
50 if (nIDComboBox == cmb2)
51 - dm->u1.s1.dmPaperSize = oldWord;
52 + dm->u.s.dmPaperSize = oldWord;
54 - dm->dmDefaultSource = oldWord;
55 + dm->u.s.dmDefaultSource = oldWord;
62 if (nIDComboBox == cmb2)
63 - oldWord = dm->u1.s1.dmPaperSize;
64 + oldWord = dm->u.s.dmPaperSize;
66 - oldWord = dm->dmDefaultSource;
67 + oldWord = dm->u.s.dmDefaultSource;
72 if (lppd->hDevMode == 0)
73 copies = lppd->nCopies;
75 - copies = lpdm->dmCopies;
76 + copies = lpdm->u.s.dmCopies;
77 if(copies == 0) copies = 1;
78 else if(copies < 0) copies = MAX_COPIES;
79 SetDlgItemInt(hDlg, edt3, copies, FALSE);
81 ShowWindow(GetDlgItem(hDlg, chx1), SW_HIDE);
83 } else { /* PD_PRINTSETUP */
84 - BOOL bPortrait = (lpdm->u1.s1.dmOrientation == DMORIENT_PORTRAIT);
85 + BOOL bPortrait = (lpdm->u.s.dmOrientation == DMORIENT_PORTRAIT);
87 PRINTDLG_SetUpPaperComboBoxA(hDlg, cmb2,
88 PrintStructures->lpPrinterInfo->pPrinterName,
90 if (lppd->hDevMode == 0)
91 copies = lppd->nCopies;
93 - copies = lpdm->dmCopies;
94 + copies = lpdm->u.s.dmCopies;
95 if(copies == 0) copies = 1;
96 else if(copies < 0) copies = MAX_COPIES;
97 SetDlgItemInt(hDlg, edt3, copies, FALSE);
99 ShowWindow(GetDlgItem(hDlg, chx1), SW_HIDE);
101 } else { /* PD_PRINTSETUP */
102 - BOOL bPortrait = (lpdm->u1.s1.dmOrientation == DMORIENT_PORTRAIT);
103 + BOOL bPortrait = (lpdm->u.s.dmOrientation == DMORIENT_PORTRAIT);
105 PRINTDLG_SetUpPaperComboBoxW(hDlg, cmb2,
106 PrintStructures->lpPrinterInfo->pPrinterName,
107 @@ -1519,7 +1519,7 @@
108 case rad1: /* Paperorientation */
109 if (lppd->Flags & PD_PRINTSETUP)
111 - lpdm->u1.s1.dmOrientation = DMORIENT_PORTRAIT;
112 + lpdm->u.s.dmOrientation = DMORIENT_PORTRAIT;
113 SendDlgItemMessageA(hDlg, ico1, STM_SETIMAGE, (WPARAM) IMAGE_ICON,
114 (LPARAM)(PrintStructures->hPortraitIcon));
116 @@ -1528,7 +1528,7 @@
117 case rad2: /* Paperorientation */
118 if (lppd->Flags & PD_PRINTSETUP)
120 - lpdm->u1.s1.dmOrientation = DMORIENT_LANDSCAPE;
121 + lpdm->u.s.dmOrientation = DMORIENT_LANDSCAPE;
122 SendDlgItemMessageA(hDlg, ico1, STM_SETIMAGE, (WPARAM) IMAGE_ICON,
123 (LPARAM)(PrintStructures->hLandscapeIcon));
125 @@ -1552,7 +1552,7 @@
127 DWORD Sel = SendDlgItemMessageA(hDlg, cmb2, CB_GETCURSEL, 0, 0);
129 - lpdm->u1.s1.dmPaperSize = SendDlgItemMessageA(hDlg, cmb2,
130 + lpdm->u.s.dmPaperSize = SendDlgItemMessageA(hDlg, cmb2,
134 @@ -1562,7 +1562,7 @@
136 DWORD Sel = SendDlgItemMessageA(hDlg, cmb3, CB_GETCURSEL, 0, 0);
138 - lpdm->dmDefaultSource = SendDlgItemMessageA(hDlg, cmb3,
139 + lpdm->u.s.dmDefaultSource = SendDlgItemMessageA(hDlg, cmb3,
143 @@ -1573,8 +1573,8 @@
144 case rad1: /* orientation */
146 if (IsDlgButtonChecked(hDlg, rad1) == BST_CHECKED) {
147 - if(lpdm->u1.s1.dmOrientation != DMORIENT_PORTRAIT) {
148 - lpdm->u1.s1.dmOrientation = DMORIENT_PORTRAIT;
149 + if(lpdm->u.s.dmOrientation != DMORIENT_PORTRAIT) {
150 + lpdm->u.s.dmOrientation = DMORIENT_PORTRAIT;
151 SendDlgItemMessageA(hDlg, stc10, STM_SETIMAGE,
153 (LPARAM)PrintStructures->hPortraitIcon);
154 @@ -1583,8 +1583,8 @@
155 (LPARAM)PrintStructures->hPortraitIcon);
158 - if(lpdm->u1.s1.dmOrientation != DMORIENT_LANDSCAPE) {
159 - lpdm->u1.s1.dmOrientation = DMORIENT_LANDSCAPE;
160 + if(lpdm->u.s.dmOrientation != DMORIENT_LANDSCAPE) {
161 + lpdm->u.s.dmOrientation = DMORIENT_LANDSCAPE;
162 SendDlgItemMessageA(hDlg, stc10, STM_SETIMAGE,
164 (LPARAM)PrintStructures->hLandscapeIcon);
165 @@ -1683,7 +1683,7 @@
166 case rad1: /* Paperorientation */
167 if (lppd->Flags & PD_PRINTSETUP)
169 - lpdm->u1.s1.dmOrientation = DMORIENT_PORTRAIT;
170 + lpdm->u.s.dmOrientation = DMORIENT_PORTRAIT;
171 SendDlgItemMessageW(hDlg, ico1, STM_SETIMAGE, (WPARAM) IMAGE_ICON,
172 (LPARAM)(PrintStructures->hPortraitIcon));
174 @@ -1692,7 +1692,7 @@
175 case rad2: /* Paperorientation */
176 if (lppd->Flags & PD_PRINTSETUP)
178 - lpdm->u1.s1.dmOrientation = DMORIENT_LANDSCAPE;
179 + lpdm->u.s.dmOrientation = DMORIENT_LANDSCAPE;
180 SendDlgItemMessageW(hDlg, ico1, STM_SETIMAGE, (WPARAM) IMAGE_ICON,
181 (LPARAM)(PrintStructures->hLandscapeIcon));
183 @@ -1716,7 +1716,7 @@
185 DWORD Sel = SendDlgItemMessageW(hDlg, cmb2, CB_GETCURSEL, 0, 0);
187 - lpdm->u1.s1.dmPaperSize = SendDlgItemMessageW(hDlg, cmb2,
188 + lpdm->u.s.dmPaperSize = SendDlgItemMessageW(hDlg, cmb2,
192 @@ -1726,7 +1726,7 @@
194 DWORD Sel = SendDlgItemMessageW(hDlg, cmb3, CB_GETCURSEL, 0, 0);
196 - lpdm->dmDefaultSource = SendDlgItemMessageW(hDlg, cmb3,
197 + lpdm->u.s.dmDefaultSource = SendDlgItemMessageW(hDlg, cmb3,
201 @@ -1737,8 +1737,8 @@
202 case rad1: /* orientation */
204 if (IsDlgButtonChecked(hDlg, rad1) == BST_CHECKED) {
205 - if(lpdm->u1.s1.dmOrientation != DMORIENT_PORTRAIT) {
206 - lpdm->u1.s1.dmOrientation = DMORIENT_PORTRAIT;
207 + if(lpdm->u.s.dmOrientation != DMORIENT_PORTRAIT) {
208 + lpdm->u.s.dmOrientation = DMORIENT_PORTRAIT;
209 SendDlgItemMessageW(hDlg, stc10, STM_SETIMAGE,
211 (LPARAM)PrintStructures->hPortraitIcon);
212 @@ -1747,8 +1747,8 @@
213 (LPARAM)PrintStructures->hPortraitIcon);
216 - if(lpdm->u1.s1.dmOrientation != DMORIENT_LANDSCAPE) {
217 - lpdm->u1.s1.dmOrientation = DMORIENT_LANDSCAPE;
218 + if(lpdm->u.s.dmOrientation != DMORIENT_LANDSCAPE) {
219 + lpdm->u.s.dmOrientation = DMORIENT_LANDSCAPE;
220 SendDlgItemMessageW(hDlg, stc10, STM_SETIMAGE,
222 (LPARAM)PrintStructures->hLandscapeIcon);
223 @@ -2513,15 +2513,15 @@
225 /* Save paper orientation into device context */
226 if(pda->curdlg.ptPaperSize.x > pda->curdlg.ptPaperSize.y)
227 - dm->u1.s1.dmOrientation = DMORIENT_LANDSCAPE;
228 + dm->u.s.dmOrientation = DMORIENT_LANDSCAPE;
230 - dm->u1.s1.dmOrientation = DMORIENT_PORTRAIT;
231 + dm->u.s.dmOrientation = DMORIENT_PORTRAIT;
233 /* Save paper size into the device context */
234 paperword = SendDlgItemMessageA(hDlg,cmb2,CB_GETITEMDATA,
235 SendDlgItemMessageA(hDlg, cmb2, CB_GETCURSEL, 0, 0), 0);
236 if (paperword != CB_ERR)
237 - dm->u1.s1.dmPaperSize = paperword;
238 + dm->u.s.dmPaperSize = paperword;
240 FIXME("could not get dialog text for papersize cmbbox?\n");
242 @@ -2529,7 +2529,7 @@
243 paperword = SendDlgItemMessageA(hDlg,cmb1,CB_GETITEMDATA,
244 SendDlgItemMessageA(hDlg, cmb1, CB_GETCURSEL, 0, 0), 0);
245 if (paperword != CB_ERR)
246 - dm->dmDefaultSource = paperword;
247 + dm->u.s.dmDefaultSource = paperword;
249 FIXME("could not get dialog text for papersize cmbbox?\n");
251 @@ -2580,9 +2580,9 @@
253 /* Save orientation */
254 if (pda->dlga->ptPaperSize.x > pda->dlga->ptPaperSize.y)
255 - dm->u1.s1.dmOrientation = DMORIENT_LANDSCAPE;
256 + dm->u.s.dmOrientation = DMORIENT_LANDSCAPE;
258 - dm->u1.s1.dmOrientation = DMORIENT_PORTRAIT;
259 + dm->u.s.dmOrientation = DMORIENT_PORTRAIT;
261 GlobalUnlock(pda->pdlg.hDevNames);
262 GlobalUnlock(pda->pdlg.hDevMode);
263 @@ -2834,7 +2834,7 @@
265 if(msg == CBN_SELCHANGE){
266 DEVMODEA *dm = GlobalLock(pda->pdlg.hDevMode);
267 - dm->dmDefaultSource = SendDlgItemMessageA(hDlg, cmb3,CB_GETITEMDATA,
268 + dm->u.s.dmDefaultSource = SendDlgItemMessageA(hDlg, cmb3,CB_GETITEMDATA,
269 SendDlgItemMessageA(hDlg, cmb3, CB_GETCURSEL, 0, 0), 0);
270 GlobalUnlock(pda->pdlg.hDevMode);
272 @@ -2857,10 +2857,10 @@
273 DM_IN_BUFFER | DM_OUT_BUFFER | DM_IN_PROMPT);
274 ClosePrinter(hPrinter);
276 - PRINTDLG_PaperSizeA(&(pda->pdlg), dm->u1.s1.dmPaperSize, &(pda->curdlg.ptPaperSize));
277 + PRINTDLG_PaperSizeA(&(pda->pdlg), dm->u.s.dmPaperSize, &(pda->curdlg.ptPaperSize));
278 pda->curdlg.ptPaperSize.x = _c_10mm2size(pda->dlga, pda->curdlg.ptPaperSize.x);
279 pda->curdlg.ptPaperSize.y = _c_10mm2size(pda->dlga, pda->curdlg.ptPaperSize.y);
280 - if (dm->u1.s1.dmOrientation == DMORIENT_LANDSCAPE){
281 + if (dm->u.s.dmOrientation == DMORIENT_LANDSCAPE){
282 DWORD tmp = pda->curdlg.ptPaperSize.x;
283 pda->curdlg.ptPaperSize.x = pda->curdlg.ptPaperSize.y;
284 pda->curdlg.ptPaperSize.y = tmp;
285 @@ -2874,7 +2874,7 @@
286 count = SendDlgItemMessageA(hDlg, cmb2, CB_GETCOUNT, 0, 0);
288 for(i=0; i<count; ++i){
289 - if(SendDlgItemMessageA(hDlg, cmb2, CB_GETITEMDATA, i, 0) == dm->u1.s1.dmPaperSize) {
290 + if(SendDlgItemMessageA(hDlg, cmb2, CB_GETITEMDATA, i, 0) == dm->u.s.dmPaperSize) {
291 SendDlgItemMessageA(hDlg, cmb2, CB_SETCURSEL, i, 0);
294 @@ -3180,7 +3180,7 @@
295 if(pda->dlga->hDevMode)
297 dm = GlobalLock(pda->dlga->hDevMode);
298 - if (dm->u1.s1.dmOrientation == DMORIENT_LANDSCAPE)
299 + if (dm->u.s.dmOrientation == DMORIENT_LANDSCAPE)
300 CheckRadioButton(hDlg, rad1, rad2, rad2);
301 else /* this is default if papersize is not set */
302 CheckRadioButton(hDlg, rad1, rad2, rad1);
303 @@ -3226,8 +3226,8 @@
304 PRINTDLG_PS_ChangePrinterA(hDlg, pda);
305 dm = GlobalLock(pda->pdlg.hDevMode);
307 - dm->dmDefaultSource = 15; /*FIXME: Automatic select. Does it always 15 at start? */
308 - PRINTDLG_PaperSizeA(&(pda->pdlg), dm->u1.s1.dmPaperSize, &pda->curdlg.ptPaperSize);
309 + dm->u.s.dmDefaultSource = 15; /*FIXME: Automatic select. Does it always 15 at start? */
310 + PRINTDLG_PaperSizeA(&(pda->pdlg), dm->u.s.dmPaperSize, &pda->curdlg.ptPaperSize);
311 GlobalUnlock(pda->pdlg.hDevMode);
312 pda->curdlg.ptPaperSize.x = _c_10mm2size(pda->dlga, pda->curdlg.ptPaperSize.x);
313 pda->curdlg.ptPaperSize.y = _c_10mm2size(pda->dlga, pda->curdlg.ptPaperSize.y);
314 @@ -3297,7 +3297,7 @@
316 dm = GlobalLock(pda->dlga->hDevMode);
317 /* Landscape orientation */
318 - if (dm->u1.s1.dmOrientation == DMORIENT_LANDSCAPE)
319 + if (dm->u.s.dmOrientation == DMORIENT_LANDSCAPE)
320 CheckRadioButton(hDlg, rad1, rad2, rad2);
321 else /* this is default if papersize is not set */
322 CheckRadioButton(hDlg, rad1, rad2, rad1);
323 @@ -3439,7 +3439,7 @@
324 setupdlg->hDevMode = pdlg.hDevMode;
325 setupdlg->hDevNames = pdlg.hDevNames;
326 dm = GlobalLock(pdlg.hDevMode);
327 - PRINTDLG_PaperSizeA(&pdlg, dm->u1.s1.dmPaperSize, &setupdlg->ptPaperSize);
328 + PRINTDLG_PaperSizeA(&pdlg, dm->u.s.dmPaperSize, &setupdlg->ptPaperSize);
329 GlobalUnlock(pdlg.hDevMode);
330 setupdlg->ptPaperSize.x=_c_10mm2size(setupdlg,setupdlg->ptPaperSize.x);
331 setupdlg->ptPaperSize.y=_c_10mm2size(setupdlg,setupdlg->ptPaperSize.y);