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
4152c14d
Commit
4152c14d
authored
Mar 28, 2007
by
Clinton Stimpson
Committed by
Alexandre Julliard
Mar 29, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Fix text replacement with text limit.
parent
6d1402cd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
caret.c
dlls/riched20/caret.c
+7
-5
editor.c
dlls/riched20/tests/editor.c
+14
-0
No files found.
dlls/riched20/caret.c
View file @
4152c14d
...
...
@@ -431,19 +431,21 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
{
const
WCHAR
*
pos
;
ME_Cursor
*
p
=
NULL
;
int
freeSpace
;
/* FIXME really HERE ? */
if
(
ME_IsSelection
(
editor
))
ME_DeleteSelection
(
editor
);
/* FIXME: is this too slow? */
/* Didn't affect performance for WM_SETTEXT (around 50sec/30K) */
int
freeSpace
=
editor
->
nTextLimit
-
ME_GetTextLength
(
editor
);
freeSpace
=
editor
->
nTextLimit
-
ME_GetTextLength
(
editor
);
/* text operations set modified state */
editor
->
nModifyStep
=
1
;
assert
(
style
);
/* FIXME really HERE ? */
if
(
ME_IsSelection
(
editor
))
ME_DeleteSelection
(
editor
);
assert
(
nCursor
>=
0
&&
nCursor
<
editor
->
nCursors
);
if
(
len
==
-
1
)
len
=
lstrlenW
(
str
);
...
...
dlls/riched20/tests/editor.c
View file @
4152c14d
...
...
@@ -1019,7 +1019,9 @@ static void test_EM_LIMITTEXT(void)
static
void
test_EM_EXLIMITTEXT
(
void
)
{
int
i
,
selBegin
,
selEnd
,
len1
,
len2
;
int
result
;
char
text
[
1024
+
1
];
char
buffer
[
1024
+
1
];
int
textlimit
=
0
;
/* multiple of 100 */
HWND
hwndRichEdit
=
new_richedit
(
NULL
);
...
...
@@ -1087,6 +1089,18 @@ static void test_EM_EXLIMITTEXT(void)
"EM_EXLIMITTEXT: No Change Expected
\n
Old Length: %d, New Length: %d, Limit: %d
\n
"
,
len1
,
len2
,
i
);
/* set text up to the limit, select all the text, then add a char */
textlimit
=
5
;
memset
(
text
,
'W'
,
textlimit
);
text
[
textlimit
]
=
0
;
SendMessage
(
hwndRichEdit
,
EM_EXLIMITTEXT
,
0
,
textlimit
);
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
text
);
SendMessage
(
hwndRichEdit
,
EM_SETSEL
,
0
,
-
1
);
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
'A'
,
1
);
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
result
=
strcmp
(
buffer
,
"A"
);
ok
(
0
==
result
,
"got string =
\"
%s
\"\n
"
,
buffer
);
DestroyWindow
(
hwndRichEdit
);
}
...
...
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