Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5f15c1c1
Commit
5f15c1c1
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: Fix parsing of the margin edit controls.
parent
11e028be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
19 deletions
+47
-19
printdlg.c
dlls/comdlg32/printdlg.c
+47
-19
No files found.
dlls/comdlg32/printdlg.c
View file @
5f15c1c1
...
...
@@ -2856,14 +2856,6 @@ PRINTDLG_PS_ChangePaperPrev(const PageSetupDataA *pda)
return
TRUE
;
}
#define GETVAL(idc,val) \
if(msg == EN_CHANGE){ \
if (GetDlgItemTextA(hDlg,idc,buf,sizeof(buf)) > 0)\
val = _c_str2sizeA(pda->dlga,buf); \
else\
FIXME("could not get dlgitemtexta for %x\n",id); \
}
static
inline
LONG
*
element_from_margin_id
(
RECT
*
rc
,
WORD
id
)
{
switch
(
id
)
...
...
@@ -2891,6 +2883,50 @@ static void update_margin_edits(HWND hDlg, const PageSetupDataA *pda, WORD id)
}
}
static
void
margin_edit_notification
(
HWND
hDlg
,
PageSetupDataA
*
pda
,
WORD
msg
,
WORD
id
)
{
switch
(
msg
)
{
case
EN_CHANGE
:
{
WCHAR
buf
[
10
];
LONG
val
=
0
;
LONG
*
value
=
element_from_margin_id
(
&
pda
->
dlga
->
rtMargin
,
id
);
if
(
GetDlgItemTextW
(
hDlg
,
id
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]))
!=
0
)
{
WCHAR
*
end
;
WCHAR
decimal
=
'.'
;
val
=
strtolW
(
buf
,
&
end
,
10
);
if
(
end
!=
buf
||
*
end
==
decimal
)
{
int
mult
=
is_metric
(
pda
)
?
100
:
1000
;
val
*=
mult
;
if
(
*
end
==
decimal
)
{
while
(
mult
>
1
)
{
end
++
;
mult
/=
10
;
if
(
isdigitW
(
*
end
))
val
+=
(
*
end
-
'0'
)
*
mult
;
else
break
;
}
}
}
}
*
value
=
val
;
return
;
}
case
EN_KILLFOCUS
:
update_margin_edits
(
hDlg
,
pda
,
id
);
return
;
}
}
static
void
set_margin_groupbox_title
(
HWND
hDlg
,
const
PageSetupDataA
*
pda
)
{
WCHAR
title
[
256
];
...
...
@@ -2917,8 +2953,7 @@ PRINTDLG_PS_WMCommandA(
)
{
WORD
msg
=
HIWORD
(
wParam
);
WORD
id
=
LOWORD
(
wParam
);
char
buf
[
200
];
TRACE
(
"loword (lparam) %d, wparam 0x%lx, lparam %08lx
\n
"
,
LOWORD
(
lParam
),
wParam
,
lParam
);
switch
(
id
)
{
...
...
@@ -3047,22 +3082,15 @@ PRINTDLG_PS_WMCommandA(
break
;
}
case
edt4
:
GETVAL
(
id
,
pda
->
dlga
->
rtMargin
.
left
);
break
;
case
edt5
:
GETVAL
(
id
,
pda
->
dlga
->
rtMargin
.
top
);
break
;
case
edt6
:
GETVAL
(
id
,
pda
->
dlga
->
rtMargin
.
right
);
break
;
case
edt7
:
GETVAL
(
id
,
pda
->
dlga
->
rtMargin
.
bottom
);
break
;
margin_edit_notification
(
hDlg
,
pda
,
msg
,
id
);
break
;
}
InvalidateRect
(
GetDlgItem
(
hDlg
,
rct1
),
NULL
,
TRUE
);
return
FALSE
;
}
#undef GETVAL
static
BOOL
PRINTDLG_PS_WMCommandW
(
...
...
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