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
68b9018d
Commit
68b9018d
authored
Jul 22, 2014
by
Jactry Zeng
Committed by
Alexandre Julliard
Jul 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Fix ME_SetSelection when cpMax > strlen().
parent
e73bd253
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
caret.c
dlls/riched20/caret.c
+12
-1
editor.c
dlls/riched20/tests/editor.c
+8
-6
No files found.
dlls/riched20/caret.c
View file @
68b9018d
...
...
@@ -139,6 +139,7 @@ int ME_SetSelection(ME_TextEditor *editor, int from, int to)
{
ME_SetCursorToStart
(
editor
,
&
editor
->
pCursors
[
1
]);
ME_SetCursorToEnd
(
editor
,
&
editor
->
pCursors
[
0
]);
editor
->
pCursors
[
0
].
nOffset
=
editor
->
pCursors
[
0
].
pRun
->
member
.
run
.
len
;
ME_InvalidateSelection
(
editor
);
return
len
+
1
;
}
...
...
@@ -159,6 +160,11 @@ int ME_SetSelection(ME_TextEditor *editor, int from, int to)
ME_GetSelectionOfs
(
editor
,
&
start
,
&
end
);
if
(
start
!=
end
)
{
if
(
end
>
len
)
{
editor
->
pCursors
[
0
].
nOffset
=
0
;
end
--
;
}
editor
->
pCursors
[
1
]
=
editor
->
pCursors
[
0
];
ME_Repaint
(
editor
);
}
...
...
@@ -200,7 +206,12 @@ int ME_SetSelection(ME_TextEditor *editor, int from, int to)
if
(
editor
->
pCursors
[
1
].
pRun
->
member
.
run
.
nFlags
&
MERF_ENDPARA
)
editor
->
pCursors
[
1
].
nOffset
=
0
;
if
(
editor
->
pCursors
[
0
].
pRun
->
member
.
run
.
nFlags
&
MERF_ENDPARA
)
editor
->
pCursors
[
0
].
nOffset
=
0
;
{
if
(
to
>
len
)
editor
->
pCursors
[
0
].
nOffset
=
editor
->
pCursors
[
0
].
pRun
->
member
.
run
.
len
;
else
editor
->
pCursors
[
0
].
nOffset
=
0
;
}
return
to
;
}
...
...
dlls/riched20/tests/editor.c
View file @
68b9018d
...
...
@@ -4363,7 +4363,9 @@ const struct exsetsel_s exsetsel_tests[] = {
{
5
,
10
,
10
,
5
,
10
,
0
},
{
15
,
17
,
17
,
15
,
17
,
0
},
/* test cpMax > strlen() */
{
0
,
100
,
18
,
0
,
18
,
1
},
{
0
,
100
,
18
,
0
,
18
,
0
},
/* test cpMin < 0 && cpMax >= 0 after cpMax > strlen() */
{
-
1
,
1
,
17
,
17
,
17
,
0
},
/* test cpMin == cpMax */
{
5
,
5
,
5
,
5
,
5
,
0
},
/* test cpMin < 0 && cpMax >= 0 (bug 4462) */
...
...
@@ -4373,13 +4375,13 @@ const struct exsetsel_s exsetsel_tests[] = {
/* test cpMin < 0 && cpMax < 0 */
{
-
1
,
-
1
,
17
,
17
,
17
,
0
},
{
-
4
,
-
5
,
17
,
17
,
17
,
0
},
/* test cMin >=0 && cpMax < 0 (bug 6814) */
{
0
,
-
1
,
18
,
0
,
18
,
1
},
{
17
,
-
5
,
18
,
17
,
18
,
1
},
/* test c
p
Min >=0 && cpMax < 0 (bug 6814) */
{
0
,
-
1
,
18
,
0
,
18
,
0
},
{
17
,
-
5
,
18
,
17
,
18
,
0
},
{
18
,
-
3
,
17
,
17
,
17
,
0
},
/* test if cpMin > cpMax */
{
15
,
19
,
18
,
15
,
18
,
1
},
{
19
,
15
,
18
,
15
,
18
,
1
}
{
15
,
19
,
18
,
15
,
18
,
0
},
{
19
,
15
,
18
,
15
,
18
,
0
},
};
static
void
check_EM_EXSETSEL
(
HWND
hwnd
,
const
struct
exsetsel_s
*
setsel
,
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