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
6fab4754
Commit
6fab4754
authored
Jun 17, 2008
by
Dylan Smith
Committed by
Alexandre Julliard
Jun 20, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Fixed the font size validation for the toolbar's combobox.
parent
536edd7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
wordpad.c
programs/wordpad/wordpad.c
+8
-5
No files found.
programs/wordpad/wordpad.c
View file @
6fab4754
...
...
@@ -219,20 +219,22 @@ static void set_caption(LPCWSTR wszNewFileName)
static
BOOL
validate_endptr
(
LPCSTR
endptr
,
BOOL
units
)
{
if
(
!
endptr
||
!*
endptr
)
if
(
!
endptr
)
return
FALSE
;
if
(
!*
endptr
)
return
TRUE
;
while
(
*
endptr
==
' '
)
endptr
++
;
if
(
!
units
)
return
*
endptr
!
=
'\0'
;
return
*
endptr
=
=
'\0'
;
/* FIXME: Allow other units and convert between them */
if
(
!
lstrcmpA
(
endptr
,
units_cmA
))
endptr
+=
2
;
return
*
endptr
!
=
'\0'
;
return
*
endptr
=
=
'\0'
;
}
static
BOOL
number_from_string
(
LPCWSTR
string
,
float
*
num
,
BOOL
units
)
...
...
@@ -246,7 +248,7 @@ static BOOL number_from_string(LPCWSTR string, float *num, BOOL units)
errno
=
0
;
ret
=
strtod
(
buffer
,
&
endptr
);
if
((
ret
==
0
&&
errno
!=
0
)
||
endptr
==
buffer
||
validate_endptr
(
endptr
,
units
))
if
((
ret
==
0
&&
errno
!=
0
)
||
endptr
==
buffer
||
!
validate_endptr
(
endptr
,
units
))
{
return
FALSE
;
}
else
...
...
@@ -1795,7 +1797,8 @@ static LRESULT OnNotify( HWND hWnd, WPARAM wParam, LPARAM lParam)
if
(
lstrcmpW
(
sizeBuffer
,
(
LPWSTR
)
endEdit
->
szText
))
{
float
size
=
0
;
if
(
number_from_string
((
LPWSTR
)
endEdit
->
szText
,
&
size
,
FALSE
))
if
(
number_from_string
((
LPWSTR
)
endEdit
->
szText
,
&
size
,
FALSE
)
&&
size
>
0
)
{
set_size
(
size
);
}
else
...
...
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