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
0014e504
Commit
0014e504
authored
Feb 20, 2006
by
Lei Zhang
Committed by
Alexandre Julliard
Feb 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Fix for EM_FINDTEXT input validation.
Fixed the cpMin/cpMax validation code for EM_FINDTEXT. Removed todo flag from affected EM_FINDTEXT tests.
parent
2aa6e2eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
+22
-12
editor.c
dlls/riched20/editor.c
+17
-7
editor.c
dlls/riched20/tests/editor.c
+5
-5
No files found.
dlls/riched20/editor.c
View file @
0014e504
...
@@ -778,18 +778,28 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, CHARRANGE *chrg, WCHAR *text, CH
...
@@ -778,18 +778,28 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, CHARRANGE *chrg, WCHAR *text, CH
if
(
flags
&
~
(
FR_DOWN
|
FR_MATCHCASE
))
if
(
flags
&
~
(
FR_DOWN
|
FR_MATCHCASE
))
FIXME
(
"Flags 0x%08lx not implemented
\n
"
,
flags
&
~
(
FR_DOWN
|
FR_MATCHCASE
));
FIXME
(
"Flags 0x%08lx not implemented
\n
"
,
flags
&
~
(
FR_DOWN
|
FR_MATCHCASE
));
nMin
=
chrg
->
cpMin
;
if
(
chrg
->
cpMax
==
-
1
)
if
(
chrg
->
cpMax
==
-
1
)
{
nMin
=
chrg
->
cpMin
;
nMax
=
ME_GetTextLength
(
editor
);
nMax
=
ME_GetTextLength
(
editor
);
}
else
else
nMax
=
chrg
->
cpMax
;
/* when searching up, if cpMin < cpMax, then instead of searching
* on [cpMin,cpMax], we search on [0,cpMin], otherwise, search on
* [cpMax, cpMin]
*/
if
(
!
(
flags
&
FR_DOWN
))
{
{
nMin
=
min
(
chrg
->
cpMin
,
chrg
->
cpMax
);
int
nSwap
=
nMax
;
nMax
=
max
(
chrg
->
cpMin
,
chrg
->
cpMax
);
nMax
=
nMin
;
if
(
nMin
<
nSwap
)
nMin
=
0
;
else
nMin
=
nSwap
;
}
}
if
(
!
nLen
||
nMin
<
0
||
nMax
<
0
)
if
(
!
nLen
||
nMin
<
0
||
nMax
<
0
||
nMax
<
nMin
)
{
{
if
(
chrgText
)
if
(
chrgText
)
chrgText
->
cpMin
=
chrgText
->
cpMax
=
-
1
;
chrgText
->
cpMin
=
chrgText
->
cpMax
=
-
1
;
...
...
dlls/riched20/tests/editor.c
View file @
0014e504
...
@@ -71,8 +71,8 @@ struct find_s find_tests2[] = {
...
@@ -71,8 +71,8 @@ struct find_s find_tests2[] = {
{
24
,
31
,
"Wine"
,
FR_DOWN
|
FR_MATCHCASE
,
27
,
0
},
{
24
,
31
,
"Wine"
,
FR_DOWN
|
FR_MATCHCASE
,
27
,
0
},
/* Find backwards */
/* Find backwards */
{
19
,
20
,
"Wine"
,
FR_MATCHCASE
,
13
,
1
},
{
19
,
20
,
"Wine"
,
FR_MATCHCASE
,
13
,
0
},
{
10
,
20
,
"Wine"
,
FR_MATCHCASE
,
4
,
1
},
{
10
,
20
,
"Wine"
,
FR_MATCHCASE
,
4
,
0
},
{
20
,
10
,
"Wine"
,
FR_MATCHCASE
,
13
,
0
},
{
20
,
10
,
"Wine"
,
FR_MATCHCASE
,
13
,
0
},
/* Case-insensitive */
/* Case-insensitive */
...
@@ -80,7 +80,7 @@ struct find_s find_tests2[] = {
...
@@ -80,7 +80,7 @@ struct find_s find_tests2[] = {
{
1
,
31
,
"Wine"
,
FR_DOWN
,
4
,
0
},
{
1
,
31
,
"Wine"
,
FR_DOWN
,
4
,
0
},
/* High-to-low ranges */
/* High-to-low ranges */
{
20
,
5
,
"Wine"
,
FR_DOWN
,
-
1
,
1
},
{
20
,
5
,
"Wine"
,
FR_DOWN
,
-
1
,
0
},
{
2
,
1
,
"Wine"
,
FR_DOWN
,
-
1
,
0
},
{
2
,
1
,
"Wine"
,
FR_DOWN
,
-
1
,
0
},
{
30
,
29
,
"Wine"
,
FR_DOWN
,
-
1
,
0
},
{
30
,
29
,
"Wine"
,
FR_DOWN
,
-
1
,
0
},
{
20
,
5
,
"Wine"
,
0
,
13
,
0
},
{
20
,
5
,
"Wine"
,
0
,
13
,
0
},
...
@@ -110,8 +110,8 @@ struct find_s find_tests2[] = {
...
@@ -110,8 +110,8 @@ struct find_s find_tests2[] = {
/* The backwards case of bug 4479; bounds look right
/* The backwards case of bug 4479; bounds look right
* Fails because backward find is wrong */
* Fails because backward find is wrong */
{
19
,
20
,
"WINE"
,
FR_MATCHCASE
,
0
,
1
},
{
19
,
20
,
"WINE"
,
FR_MATCHCASE
,
0
,
0
},
{
0
,
20
,
"WINE"
,
FR_MATCHCASE
,
-
1
,
1
}
{
0
,
20
,
"WINE"
,
FR_MATCHCASE
,
-
1
,
0
}
};
};
static
void
check_EM_FINDTEXT
(
HWND
hwnd
,
char
*
name
,
struct
find_s
*
f
,
int
id
)
{
static
void
check_EM_FINDTEXT
(
HWND
hwnd
,
char
*
name
,
struct
find_s
*
f
,
int
id
)
{
...
...
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