Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e75b7ad7
Commit
e75b7ad7
authored
Jan 19, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Jan 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Let pagesetup_update_papersize take care of landscape mode.
parent
276434ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
34 deletions
+26
-34
printdlg.c
dlls/comdlg32/printdlg.c
+26
-34
No files found.
dlls/comdlg32/printdlg.c
View file @
e75b7ad7
...
...
@@ -25,6 +25,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
...
...
@@ -2556,7 +2557,7 @@ static inline void rotate_rect(RECT *rc, BOOL sense)
}
}
static
BOOL
pagesetup_
papersizeA
(
PAGESETUPDLGA
*
dlg
,
const
WORD
paperword
,
LPPOINT
size
)
static
BOOL
pagesetup_
update_papersize
(
PageSetupDataA
*
pda
)
{
DEVNAMES
*
dn
;
DEVMODEA
*
dm
;
...
...
@@ -2566,8 +2567,8 @@ static BOOL pagesetup_papersizeA(PAGESETUPDLGA *dlg, const WORD paperword, LPPOI
POINT
*
points
=
NULL
;
BOOL
retval
=
FALSE
;
dn
=
GlobalLock
(
dlg
->
hDevNames
);
dm
=
GlobalLock
(
dlg
->
hDevMode
);
dn
=
GlobalLock
(
pda
->
dlga
->
hDevNames
);
dm
=
GlobalLock
(
pda
->
dlga
->
hDevMode
);
devname
=
((
char
*
)
dn
)
+
dn
->
wDeviceOffset
;
portname
=
((
char
*
)
dn
)
+
dn
->
wOutputOffset
;
...
...
@@ -2594,25 +2595,32 @@ static BOOL pagesetup_papersizeA(PAGESETUPDLGA *dlg, const WORD paperword, LPPOI
}
for
(
i
=
0
;
i
<
num
;
i
++
)
if
(
words
[
i
]
==
paperword
)
if
(
words
[
i
]
==
dm
->
u1
.
s1
.
dmPaperSize
)
break
;
if
(
i
==
num
)
{
FIXME
(
"Papersize %d not found in list?
\n
"
,
paperword
);
FIXME
(
"Papersize %d not found in list?
\n
"
,
dm
->
u1
.
s1
.
dmPaperSize
);
goto
end
;
}
/* this is _10ths_ of a millimeter */
size
->
x
=
_c_10mm2size
(
dlg
,
points
[
i
].
x
);
size
->
y
=
_c_10mm2size
(
dlg
,
points
[
i
].
y
);
pda
->
dlga
->
ptPaperSize
.
x
=
_c_10mm2size
(
pda
->
dlga
,
points
[
i
].
x
);
pda
->
dlga
->
ptPaperSize
.
y
=
_c_10mm2size
(
pda
->
dlga
,
points
[
i
].
y
);
if
(
dm
->
u1
.
s1
.
dmOrientation
==
DMORIENT_LANDSCAPE
)
{
LONG
tmp
=
pda
->
dlga
->
ptPaperSize
.
x
;
pda
->
dlga
->
ptPaperSize
.
x
=
pda
->
dlga
->
ptPaperSize
.
y
;
pda
->
dlga
->
ptPaperSize
.
y
=
tmp
;
}
retval
=
TRUE
;
end:
HeapFree
(
GetProcessHeap
(),
0
,
words
);
HeapFree
(
GetProcessHeap
(),
0
,
points
);
GlobalUnlock
(
dlg
->
hDevNames
);
GlobalUnlock
(
dlg
->
hDevMode
);
GlobalUnlock
(
pda
->
dlga
->
hDevNames
);
GlobalUnlock
(
pda
->
dlga
->
hDevMode
);
return
retval
;
}
...
...
@@ -3031,12 +3039,7 @@ PRINTDLG_PS_WMCommandA(
DEVMODEA
*
dm
=
GlobalLock
(
pda
->
dlga
->
hDevMode
);
dm
->
u1
.
s1
.
dmPaperSize
=
paperword
;
GlobalUnlock
(
pda
->
dlga
->
hDevMode
);
pagesetup_papersizeA
(
pda
->
dlga
,
paperword
,
&
(
pda
->
dlga
->
ptPaperSize
));
if
(
IsDlgButtonChecked
(
hDlg
,
rad2
))
{
DWORD
tmp
=
pda
->
dlga
->
ptPaperSize
.
x
;
pda
->
dlga
->
ptPaperSize
.
x
=
pda
->
dlga
->
ptPaperSize
.
y
;
pda
->
dlga
->
ptPaperSize
.
y
=
tmp
;
}
pagesetup_update_papersize
(
pda
);
PRINTDLG_PS_ChangePaperPrev
(
pda
);
}
else
FIXME
(
"could not get dialog text for papersize cmbbox?
\n
"
);
...
...
@@ -3068,13 +3071,9 @@ PRINTDLG_PS_WMCommandA(
DM_IN_BUFFER
|
DM_OUT_BUFFER
|
DM_IN_PROMPT
);
ClosePrinter
(
hPrinter
);
/* Changing paper */
pagesetup_papersizeA
(
pda
->
dlga
,
dm
->
u1
.
s1
.
dmPaperSize
,
&
(
pda
->
dlga
->
ptPaperSize
));
if
(
dm
->
u1
.
s1
.
dmOrientation
==
DMORIENT_LANDSCAPE
){
DWORD
tmp
=
pda
->
dlga
->
ptPaperSize
.
x
;
pda
->
dlga
->
ptPaperSize
.
x
=
pda
->
dlga
->
ptPaperSize
.
y
;
pda
->
dlga
->
ptPaperSize
.
y
=
tmp
;
pagesetup_update_papersize
(
pda
);
if
(
dm
->
u1
.
s1
.
dmOrientation
==
DMORIENT_LANDSCAPE
)
CheckRadioButton
(
hDlg
,
rad1
,
rad2
,
rad2
);
}
else
CheckRadioButton
(
hDlg
,
rad1
,
rad2
,
rad1
);
/* Changing paper preview */
...
...
@@ -3470,16 +3469,11 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
/* filling combos: printer, paper, source. selecting current printer (from DEVMODEA) */
PRINTDLG_PS_ChangePrinterA
(
hDlg
,
pda
);
pagesetup_update_papersize
(
pda
);
dm
=
GlobalLock
(
pda
->
dlga
->
hDevMode
);
if
(
dm
){
dm
->
u1
.
s1
.
dmDefaultSource
=
15
;
/*FIXME: Automatic select. Does it always 15 at start? */
pagesetup_papersizeA
(
pda
->
dlga
,
dm
->
u1
.
s1
.
dmPaperSize
,
&
pda
->
dlga
->
ptPaperSize
);
GlobalUnlock
(
pda
->
dlga
->
hDevMode
);
if
(
IsDlgButtonChecked
(
hDlg
,
rad2
)
==
BST_CHECKED
)
{
/* Landscape orientation */
DWORD
tmp
=
pda
->
dlga
->
ptPaperSize
.
y
;
pda
->
dlga
->
ptPaperSize
.
y
=
pda
->
dlga
->
ptPaperSize
.
x
;
pda
->
dlga
->
ptPaperSize
.
x
=
tmp
;
}
}
else
WARN
(
"GlobalLock(pda->dlga->hDevMode) fail? hDevMode=%p
\n
"
,
pda
->
dlga
->
hDevMode
);
/* Drawing paper prev */
...
...
@@ -3671,12 +3665,13 @@ BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA setupdlg) {
setupdlg
->
hDevNames
=
pdlg
.
hDevNames
;
}
pda
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
pda
));
pda
->
dlga
=
setupdlg
;
/* short cut exit, just return default values */
if
(
setupdlg
->
Flags
&
PSD_RETURNDEFAULT
)
{
DEVMODEA
*
dm
;
dm
=
GlobalLock
(
setupdlg
->
hDevMode
);
pagesetup_papersizeA
(
setupdlg
,
dm
->
u1
.
s1
.
dmPaperSize
,
&
setupdlg
->
ptPaperSize
);
GlobalUnlock
(
setupdlg
->
hDevMode
);
pagesetup_update_papersize
(
pda
);
HeapFree
(
GetProcessHeap
(),
0
,
pda
);
return
TRUE
;
}
...
...
@@ -3692,9 +3687,6 @@ BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA setupdlg) {
return
FALSE
;
}
pda
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
pda
));
pda
->
dlga
=
setupdlg
;
bRet
=
(
0
<
DialogBoxIndirectParamW
(
setupdlg
->
hInstance
,
ptr
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment