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
b81144b3
Commit
b81144b3
authored
Jan 13, 2009
by
Dylan Smith
Committed by
Alexandre Julliard
Jan 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Correct limitations on values for setting zoom ratio.
parent
fcabbbf3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
paint.c
dlls/riched20/paint.c
+9
-8
editor.c
dlls/riched20/tests/editor.c
+8
-8
No files found.
dlls/riched20/paint.c
View file @
b81144b3
...
...
@@ -1230,18 +1230,19 @@ ME_SetZoom(ME_TextEditor *editor, int numerator, int denominator)
{
/* TODO: Zoom images and objects */
if
(
numerator
!
=
0
)
if
(
numerator
==
0
&&
denominator
=
=
0
)
{
if
(
denominator
==
0
)
return
FALSE
;
if
(
1
.
0
/
64
.
0
>
(
float
)
numerator
/
(
float
)
denominator
||
(
float
)
numerator
/
(
float
)
denominator
>
64
.
0
)
return
FALSE
;
editor
->
nZoomNumerator
=
editor
->
nZoomDenominator
=
0
;
return
TRUE
;
}
if
(
numerator
<=
0
||
denominator
<=
0
)
return
FALSE
;
if
(
numerator
*
64
<=
denominator
||
numerator
/
denominator
>=
64
)
return
FALSE
;
editor
->
nZoomNumerator
=
numerator
;
editor
->
nZoomDenominator
=
denominator
;
ME_RewrapRepaint
(
editor
);
return
TRUE
;
}
dlls/riched20/tests/editor.c
View file @
b81144b3
...
...
@@ -6376,27 +6376,27 @@ static void test_zoom(void)
ok
(
ret
==
TRUE
,
"EM_SETZOOM rejected valid values (%d).
\n
"
,
ret
);
ret
=
SendMessage
(
hwnd
,
EM_SETZOOM
,
(
WPARAM
)
2
,
(
LPARAM
)
128
);
todo_wine
ok
(
ret
==
FALSE
,
"EM_SETZOOM accepted invalid values (%d).
\n
"
,
ret
);
ok
(
ret
==
FALSE
,
"EM_SETZOOM accepted invalid values (%d).
\n
"
,
ret
);
ret
=
SendMessage
(
hwnd
,
EM_GETZOOM
,
(
WPARAM
)
&
numerator
,
(
LPARAM
)
&
denominator
);
todo_wine
ok
(
numerator
==
127
,
"incorrect numerator is %d
\n
"
,
numerator
);
todo_wine
ok
(
denominator
==
2
,
"incorrect denominator is %d
\n
"
,
denominator
);
ok
(
numerator
==
127
,
"incorrect numerator is %d
\n
"
,
numerator
);
ok
(
denominator
==
2
,
"incorrect denominator is %d
\n
"
,
denominator
);
ok
(
ret
==
TRUE
,
"EM_GETZOOM failed (%d).
\n
"
,
ret
);
ret
=
SendMessage
(
hwnd
,
EM_SETZOOM
,
(
WPARAM
)
128
,
(
LPARAM
)
2
);
todo_wine
ok
(
ret
==
FALSE
,
"EM_SETZOOM accepted invalid values (%d).
\n
"
,
ret
);
ok
(
ret
==
FALSE
,
"EM_SETZOOM accepted invalid values (%d).
\n
"
,
ret
);
/* See if negative numbers are accepted. */
ret
=
SendMessage
(
hwnd
,
EM_SETZOOM
,
(
WPARAM
)
-
100
,
(
LPARAM
)
-
100
);
todo_wine
ok
(
ret
==
FALSE
,
"EM_SETZOOM accepted invalid values (%d).
\n
"
,
ret
);
ok
(
ret
==
FALSE
,
"EM_SETZOOM accepted invalid values (%d).
\n
"
,
ret
);
/* See if negative numbers are accepted. */
ret
=
SendMessage
(
hwnd
,
EM_SETZOOM
,
(
WPARAM
)
0
,
(
LPARAM
)
100
);
todo_wine
ok
(
ret
==
FALSE
,
"EM_SETZOOM failed (%d).
\n
"
,
ret
);
ok
(
ret
==
FALSE
,
"EM_SETZOOM failed (%d).
\n
"
,
ret
);
ret
=
SendMessage
(
hwnd
,
EM_GETZOOM
,
(
WPARAM
)
&
numerator
,
(
LPARAM
)
&
denominator
);
todo_wine
ok
(
numerator
==
127
,
"incorrect numerator is %d
\n
"
,
numerator
);
todo_wine
ok
(
denominator
==
2
,
"incorrect denominator is %d
\n
"
,
denominator
);
ok
(
numerator
==
127
,
"incorrect numerator is %d
\n
"
,
numerator
);
ok
(
denominator
==
2
,
"incorrect denominator is %d
\n
"
,
denominator
);
ok
(
ret
==
TRUE
,
"EM_GETZOOM failed (%d).
\n
"
,
ret
);
/* Reset the zoom value */
...
...
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