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
276434ca
Commit
276434ca
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: Switch to using a locale dependent decimal separator.
parent
5f15c1c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
printdlg.c
dlls/comdlg32/printdlg.c
+19
-10
No files found.
dlls/comdlg32/printdlg.c
View file @
276434ca
...
...
@@ -2416,26 +2416,38 @@ _c_inch2size(PAGESETUPDLGA *dlga,DWORD size) {
return
(
size
*
254
)
/
100
;
}
static
WCHAR
get_decimal_sep
(
void
)
{
static
WCHAR
sep
;
if
(
!
sep
)
{
WCHAR
buf
[
2
]
=
{
'.'
,
0
};
GetLocaleInfoW
(
LOCALE_USER_DEFAULT
,
LOCALE_SDECIMAL
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]));
sep
=
buf
[
0
];
}
return
sep
;
}
static
void
size2str
(
const
PageSetupDataA
*
pda
,
DWORD
size
,
LPWSTR
strout
)
{
WCHAR
decimal
[
2
]
=
{
'.'
,
0
};
WCHAR
integer_fmt
[]
=
{
'%'
,
'd'
,
0
};
WCHAR
hundredths_fmt
[]
=
{
'%'
,
'd'
,
'%'
,
'
s
'
,
'%'
,
'0'
,
'2'
,
'd'
,
0
};
WCHAR
thousandths_fmt
[]
=
{
'%'
,
'd'
,
'%'
,
'
s
'
,
'%'
,
'0'
,
'3'
,
'd'
,
0
};
WCHAR
hundredths_fmt
[]
=
{
'%'
,
'd'
,
'%'
,
'
c
'
,
'%'
,
'0'
,
'2'
,
'd'
,
0
};
WCHAR
thousandths_fmt
[]
=
{
'%'
,
'd'
,
'%'
,
'
c
'
,
'%'
,
'0'
,
'3'
,
'd'
,
0
};
/* FIXME use LOCALE_SDECIMAL when the edit parsing code can cope */
if
(
is_metric
(
pda
))
{
if
(
size
%
100
)
wsprintfW
(
strout
,
hundredths_fmt
,
size
/
100
,
decimal
,
size
%
100
);
wsprintfW
(
strout
,
hundredths_fmt
,
size
/
100
,
get_decimal_sep
()
,
size
%
100
);
else
wsprintfW
(
strout
,
integer_fmt
,
size
/
100
);
}
else
{
if
(
size
%
1000
)
wsprintfW
(
strout
,
thousandths_fmt
,
size
/
1000
,
decimal
,
size
%
1000
);
wsprintfW
(
strout
,
thousandths_fmt
,
size
/
1000
,
get_decimal_sep
()
,
size
%
1000
);
else
wsprintfW
(
strout
,
integer_fmt
,
size
/
1000
);
...
...
@@ -2896,7 +2908,7 @@ static void margin_edit_notification(HWND hDlg, PageSetupDataA *pda, WORD msg, W
if
(
GetDlgItemTextW
(
hDlg
,
id
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]))
!=
0
)
{
WCHAR
*
end
;
WCHAR
decimal
=
'.'
;
WCHAR
decimal
=
get_decimal_sep
()
;
val
=
strtolW
(
buf
,
&
end
,
10
);
if
(
end
!=
buf
||
*
end
==
decimal
)
...
...
@@ -3351,13 +3363,10 @@ PRINTDLG_PagePaintProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
*/
static
LRESULT
CALLBACK
pagesetup_margin_editproc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
WCHAR
decimal
=
'.'
;
/* FIXME use LOCALE_SDECIMAL when the edit parsing code can cope */
switch
(
msg
)
case
WM_CHAR
:
{
WCHAR
decimal
=
get_decimal_sep
();
WCHAR
wc
=
(
WCHAR
)
wparam
;
if
(
!
isdigitW
(
wc
)
&&
wc
!=
decimal
&&
wc
!=
VK_BACK
)
return
0
;
}
...
...
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