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
f34cb461
Commit
f34cb461
authored
Sep 20, 2007
by
Clinton Stimpson
Committed by
Alexandre Julliard
Sep 21, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Only WM_CHAR respects text limit.
parent
ebd1ba80
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
20 deletions
+18
-20
caret.c
dlls/riched20/caret.c
+7
-3
editor.c
dlls/riched20/editor.c
+11
-5
editor.c
dlls/riched20/tests/editor.c
+0
-12
No files found.
dlls/riched20/caret.c
View file @
f34cb461
...
@@ -441,7 +441,7 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
...
@@ -441,7 +441,7 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
{
{
const
WCHAR
*
pos
;
const
WCHAR
*
pos
;
ME_Cursor
*
p
=
NULL
;
ME_Cursor
*
p
=
NULL
;
int
freeSpace
;
int
oldLen
;
/* FIXME really HERE ? */
/* FIXME really HERE ? */
if
(
ME_IsSelection
(
editor
))
if
(
ME_IsSelection
(
editor
))
...
@@ -449,7 +449,7 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
...
@@ -449,7 +449,7 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
/* FIXME: is this too slow? */
/* FIXME: is this too slow? */
/* Didn't affect performance for WM_SETTEXT (around 50sec/30K) */
/* Didn't affect performance for WM_SETTEXT (around 50sec/30K) */
freeSpace
=
editor
->
nTextLimit
-
ME_GetTextLength
(
editor
);
oldLen
=
ME_GetTextLength
(
editor
);
/* text operations set modified state */
/* text operations set modified state */
editor
->
nModifyStep
=
1
;
editor
->
nModifyStep
=
1
;
...
@@ -459,7 +459,11 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
...
@@ -459,7 +459,11 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
assert
(
nCursor
>=
0
&&
nCursor
<
editor
->
nCursors
);
assert
(
nCursor
>=
0
&&
nCursor
<
editor
->
nCursors
);
if
(
len
==
-
1
)
if
(
len
==
-
1
)
len
=
lstrlenW
(
str
);
len
=
lstrlenW
(
str
);
len
=
min
(
len
,
freeSpace
);
/* grow the text limit to fit our text */
if
(
editor
->
nTextLimit
<
oldLen
+
len
)
editor
->
nTextLimit
=
oldLen
+
len
;
while
(
len
)
while
(
len
)
{
{
pos
=
str
;
pos
=
str
;
...
...
dlls/riched20/editor.c
View file @
f34cb461
...
@@ -2413,11 +2413,17 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
...
@@ -2413,11 +2413,17 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
}
}
if
(((
unsigned
)
wstr
)
>=
' '
||
wstr
==
'\r'
||
wstr
==
'\t'
)
{
if
(((
unsigned
)
wstr
)
>=
' '
||
wstr
==
'\r'
||
wstr
==
'\t'
)
{
/* FIXME maybe it would make sense to call EM_REPLACESEL instead ? */
/* FIXME maybe it would make sense to call EM_REPLACESEL instead ? */
ME_Style
*
style
=
ME_GetInsertStyle
(
editor
,
0
);
/* WM_CHAR is restricted to nTextLimit */
ME_SaveTempStyle
(
editor
);
int
from
,
to
;
ME_InsertTextFromCursor
(
editor
,
0
,
&
wstr
,
1
,
style
);
ME_GetSelection
(
editor
,
&
from
,
&
to
);
ME_ReleaseStyle
(
style
);
if
(
editor
->
nTextLimit
>
ME_GetTextLength
(
editor
)
-
(
to
-
from
))
ME_CommitUndo
(
editor
);
{
ME_Style
*
style
=
ME_GetInsertStyle
(
editor
,
0
);
ME_SaveTempStyle
(
editor
);
ME_InsertTextFromCursor
(
editor
,
0
,
&
wstr
,
1
,
style
);
ME_ReleaseStyle
(
style
);
ME_CommitUndo
(
editor
);
}
ME_UpdateRepaint
(
editor
);
ME_UpdateRepaint
(
editor
);
}
}
return
0
;
return
0
;
...
...
dlls/riched20/tests/editor.c
View file @
f34cb461
...
@@ -1116,26 +1116,18 @@ static void test_EM_EXLIMITTEXT(void)
...
@@ -1116,26 +1116,18 @@ static void test_EM_EXLIMITTEXT(void)
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
text
);
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
text
);
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
i
=
strlen
(
buffer
);
i
=
strlen
(
buffer
);
todo_wine
{
ok
(
10
==
i
,
"expected 10 chars
\n
"
);
ok
(
10
==
i
,
"expected 10 chars
\n
"
);
}
i
=
SendMessage
(
hwndRichEdit
,
EM_GETLIMITTEXT
,
0
,
0
);
i
=
SendMessage
(
hwndRichEdit
,
EM_GETLIMITTEXT
,
0
,
0
);
todo_wine
{
ok
(
10
==
i
,
"EM_EXLIMITTEXT: expected: %d, actual: %d
\n
"
,
10
,
i
);
ok
(
10
==
i
,
"EM_EXLIMITTEXT: expected: %d, actual: %d
\n
"
,
10
,
i
);
}
/* try inserting more text at end */
/* try inserting more text at end */
i
=
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
'A'
,
0
);
i
=
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
'A'
,
0
);
ok
(
0
==
i
,
"WM_CHAR wasn't processed"
);
ok
(
0
==
i
,
"WM_CHAR wasn't processed"
);
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
i
=
strlen
(
buffer
);
i
=
strlen
(
buffer
);
todo_wine
{
ok
(
10
==
i
,
"expected 10 chars, got %i
\n
"
,
i
);
ok
(
10
==
i
,
"expected 10 chars, got %i
\n
"
,
i
);
}
i
=
SendMessage
(
hwndRichEdit
,
EM_GETLIMITTEXT
,
0
,
0
);
i
=
SendMessage
(
hwndRichEdit
,
EM_GETLIMITTEXT
,
0
,
0
);
todo_wine
{
ok
(
10
==
i
,
"EM_EXLIMITTEXT: expected: %d, actual: %d
\n
"
,
10
,
i
);
ok
(
10
==
i
,
"EM_EXLIMITTEXT: expected: %d, actual: %d
\n
"
,
10
,
i
);
}
/* try inserting text at beginning */
/* try inserting text at beginning */
SendMessage
(
hwndRichEdit
,
EM_SETSEL
,
0
,
0
);
SendMessage
(
hwndRichEdit
,
EM_SETSEL
,
0
,
0
);
...
@@ -1143,13 +1135,9 @@ todo_wine {
...
@@ -1143,13 +1135,9 @@ todo_wine {
ok
(
0
==
i
,
"WM_CHAR wasn't processed"
);
ok
(
0
==
i
,
"WM_CHAR wasn't processed"
);
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
i
=
strlen
(
buffer
);
i
=
strlen
(
buffer
);
todo_wine
{
ok
(
10
==
i
,
"expected 10 chars, got %i
\n
"
,
i
);
ok
(
10
==
i
,
"expected 10 chars, got %i
\n
"
,
i
);
}
i
=
SendMessage
(
hwndRichEdit
,
EM_GETLIMITTEXT
,
0
,
0
);
i
=
SendMessage
(
hwndRichEdit
,
EM_GETLIMITTEXT
,
0
,
0
);
todo_wine
{
ok
(
10
==
i
,
"EM_EXLIMITTEXT: expected: %d, actual: %d
\n
"
,
10
,
i
);
ok
(
10
==
i
,
"EM_EXLIMITTEXT: expected: %d, actual: %d
\n
"
,
10
,
i
);
}
/* WM_CHAR is limited */
/* WM_CHAR is limited */
textlimit
=
1
;
textlimit
=
1
;
...
...
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