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
a07e9c69
Commit
a07e9c69
authored
Apr 01, 2007
by
Rolf Kalbermatter
Committed by
Alexandre Julliard
Apr 02, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
notepad: Fix a possible rounding error when storing the font point size to the registry.
parent
3cae9203
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
main.c
programs/notepad/main.c
+4
-2
No files found.
programs/notepad/main.c
View file @
a07e9c69
...
...
@@ -144,7 +144,8 @@ static VOID NOTEPAD_SaveSettingToRegistry(void)
SET_NOTEPAD_REG
(
hkey
,
value_iMarginRight
,
Globals
.
iMarginRight
);
#undef SET_NOTEPAD_REG
data
=
(
DWORD
)(
abs
(
Globals
.
lfFont
.
lfHeight
)
*
72
/
get_dpi
()
*
10
);
/* method of native notepad.exe */
/* Store the current value as 10 * twips */
data
=
MulDiv
(
abs
(
Globals
.
lfFont
.
lfHeight
),
720
,
get_dpi
());
RegSetValueEx
(
hkey
,
value_iPointSize
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
data
,
sizeof
(
DWORD
));
RegSetValueEx
(
hkey
,
value_lfFaceName
,
0
,
REG_SZ
,
(
LPBYTE
)
&
Globals
.
lfFont
.
lfFaceName
,
...
...
@@ -239,7 +240,8 @@ static VOID NOTEPAD_LoadSettingFromRegistry(void)
size
=
sizeof
(
DWORD
);
if
(
RegQueryValueEx
(
hkey
,
value_iPointSize
,
0
,
&
type
,
(
LPBYTE
)
&
data
,
&
size
)
==
ERROR_SUCCESS
)
if
(
type
==
REG_DWORD
)
Globals
.
lfFont
.
lfHeight
=
(
LONG
)(
-
abs
(
data
/
10
*
get_dpi
()
/
72
));
/* method of native notepad.exe */
/* The value is stored as 10 * twips */
Globals
.
lfFont
.
lfHeight
=
-
MulDiv
(
abs
(
data
),
get_dpi
(),
720
);
size
=
sizeof
(
Globals
.
lfFont
.
lfFaceName
);
if
(
RegQueryValueEx
(
hkey
,
value_lfFaceName
,
0
,
&
type
,
(
LPBYTE
)
&
data_helper
,
&
size
)
==
ERROR_SUCCESS
)
...
...
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