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
13e4ddd2
Commit
13e4ddd2
authored
Aug 09, 2006
by
Ken Myers
Committed by
Alexandre Julliard
Aug 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Implement EM_EXLIMITTEXT, EM_GETLIMITTEXT and tests.
parent
15f47b22
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
116 additions
and
4 deletions
+116
-4
caret.c
dlls/riched20/caret.c
+4
-0
editor.c
dlls/riched20/editor.c
+19
-4
editstr.h
dlls/riched20/editstr.h
+1
-0
editor.c
dlls/riched20/tests/editor.c
+92
-0
No files found.
dlls/riched20/caret.c
View file @
13e4ddd2
...
@@ -383,6 +383,9 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
...
@@ -383,6 +383,9 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
{
{
const
WCHAR
*
pos
;
const
WCHAR
*
pos
;
ME_Cursor
*
p
=
NULL
;
ME_Cursor
*
p
=
NULL
;
/* FIXME: is this too slow? */
/* Didn't affect performance for WM_SETTEXT (around 50sec/30K) */
int
freeSpace
=
editor
->
nTextLimit
-
ME_GetTextLength
(
editor
);
assert
(
style
);
assert
(
style
);
...
@@ -393,6 +396,7 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
...
@@ -393,6 +396,7 @@ 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
);
while
(
len
)
while
(
len
)
{
{
pos
=
str
;
pos
=
str
;
...
...
dlls/riched20/editor.c
View file @
13e4ddd2
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
- EM_DISPLAYBAND
- EM_DISPLAYBAND
+ EM_EMPTYUNDOBUFFER
+ EM_EMPTYUNDOBUFFER
+ EM_EXGETSEL
+ EM_EXGETSEL
-
EM_EXLIMITTEXT
+
EM_EXLIMITTEXT
+ EM_EXLINEFROMCHAR
+ EM_EXLINEFROMCHAR
+ EM_EXSETSEL
+ EM_EXSETSEL
+ EM_FINDTEXT (only FR_DOWN flag implemented)
+ EM_FINDTEXT (only FR_DOWN flag implemented)
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
- EM_GETIMEOPTIONS 1.0asian
- EM_GETIMEOPTIONS 1.0asian
- EM_GETIMESTATUS
- EM_GETIMESTATUS
- EM_GETLANGOPTIONS 2.0
- EM_GETLANGOPTIONS 2.0
-
EM_GETLIMITTEXT
+
EM_GETLIMITTEXT
+ EM_GETLINE
+ EM_GETLINE
+ EM_GETLINECOUNT returns number of rows, not of paragraphs
+ EM_GETLINECOUNT returns number of rows, not of paragraphs
+ EM_GETMODIFY
+ EM_GETMODIFY
...
@@ -232,6 +232,8 @@
...
@@ -232,6 +232,8 @@
#define STACK_SIZE_DEFAULT 100
#define STACK_SIZE_DEFAULT 100
#define STACK_SIZE_MAX 1000
#define STACK_SIZE_MAX 1000
#define TEXT_LIMIT_DEFAULT 32767
WINE_DEFAULT_DEBUG_CHANNEL
(
richedit
);
WINE_DEFAULT_DEBUG_CHANNEL
(
richedit
);
...
@@ -1124,6 +1126,7 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) {
...
@@ -1124,6 +1126,7 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) {
ed
->
bCaretAtEnd
=
FALSE
;
ed
->
bCaretAtEnd
=
FALSE
;
ed
->
nEventMask
=
0
;
ed
->
nEventMask
=
0
;
ed
->
nModifyStep
=
0
;
ed
->
nModifyStep
=
0
;
ed
->
nTextLimit
=
TEXT_LIMIT_DEFAULT
;
ed
->
pUndoStack
=
ed
->
pRedoStack
=
ed
->
pUndoStackBottom
=
NULL
;
ed
->
pUndoStack
=
ed
->
pRedoStack
=
ed
->
pUndoStackBottom
=
NULL
;
ed
->
nUndoStackSize
=
0
;
ed
->
nUndoStackSize
=
0
;
ed
->
nUndoLimit
=
STACK_SIZE_DEFAULT
;
ed
->
nUndoLimit
=
STACK_SIZE_DEFAULT
;
...
@@ -1420,7 +1423,6 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
...
@@ -1420,7 +1423,6 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
switch
(
msg
)
{
switch
(
msg
)
{
UNSUPPORTED_MSG
(
EM_DISPLAYBAND
)
UNSUPPORTED_MSG
(
EM_DISPLAYBAND
)
UNSUPPORTED_MSG
(
EM_EXLIMITTEXT
)
UNSUPPORTED_MSG
(
EM_FINDWORDBREAK
)
UNSUPPORTED_MSG
(
EM_FINDWORDBREAK
)
UNSUPPORTED_MSG
(
EM_FMTLINES
)
UNSUPPORTED_MSG
(
EM_FMTLINES
)
UNSUPPORTED_MSG
(
EM_FORMATRANGE
)
UNSUPPORTED_MSG
(
EM_FORMATRANGE
)
...
@@ -1429,7 +1431,6 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
...
@@ -1429,7 +1431,6 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
UNSUPPORTED_MSG
(
EM_GETIMECOMPMODE
)
UNSUPPORTED_MSG
(
EM_GETIMECOMPMODE
)
/* UNSUPPORTED_MSG(EM_GETIMESTATUS) missing in Wine headers */
/* UNSUPPORTED_MSG(EM_GETIMESTATUS) missing in Wine headers */
UNSUPPORTED_MSG
(
EM_GETLANGOPTIONS
)
UNSUPPORTED_MSG
(
EM_GETLANGOPTIONS
)
UNSUPPORTED_MSG
(
EM_GETLIMITTEXT
)
/* UNSUPPORTED_MSG(EM_GETOLEINTERFACE) separate stub */
/* UNSUPPORTED_MSG(EM_GETOLEINTERFACE) separate stub */
UNSUPPORTED_MSG
(
EM_GETREDONAME
)
UNSUPPORTED_MSG
(
EM_GETREDONAME
)
UNSUPPORTED_MSG
(
EM_GETTEXTMODE
)
UNSUPPORTED_MSG
(
EM_GETTEXTMODE
)
...
@@ -2194,6 +2195,20 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
...
@@ -2194,6 +2195,20 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
TRACE
(
"EM_LINELENGTH(%d)==%d
\n
"
,
wParam
,
nChars
);
TRACE
(
"EM_LINELENGTH(%d)==%d
\n
"
,
wParam
,
nChars
);
return
nChars
;
return
nChars
;
}
}
case
EM_EXLIMITTEXT
:
{
if
(
wParam
!=
0
||
lParam
<
0
)
return
0
;
if
(
lParam
==
0
)
editor
->
nTextLimit
=
65536
;
else
editor
->
nTextLimit
=
(
int
)
lParam
;
return
0
;
}
case
EM_GETLIMITTEXT
:
{
return
editor
->
nTextLimit
;
}
case
EM_FINDTEXT
:
case
EM_FINDTEXT
:
{
{
FINDTEXTA
*
ft
=
(
FINDTEXTA
*
)
lParam
;
FINDTEXTA
*
ft
=
(
FINDTEXTA
*
)
lParam
;
...
...
dlls/riched20/editstr.h
View file @
13e4ddd2
...
@@ -312,6 +312,7 @@ typedef struct tagME_TextEditor
...
@@ -312,6 +312,7 @@ typedef struct tagME_TextEditor
RECT
rcFormat
;
RECT
rcFormat
;
BOOL
bRedraw
;
BOOL
bRedraw
;
int
nInvalidOfs
;
int
nInvalidOfs
;
int
nTextLimit
;
EDITWORDBREAKPROCW
pfnWordBreak
;
EDITWORDBREAKPROCW
pfnWordBreak
;
LPRICHEDITOLECALLBACK
lpOleCallback
;
LPRICHEDITOLECALLBACK
lpOleCallback
;
/*TEXTMODE variable; contains only one of each of the following options:
/*TEXTMODE variable; contains only one of each of the following options:
...
...
dlls/riched20/tests/editor.c
View file @
13e4ddd2
...
@@ -972,6 +972,96 @@ static void test_EM_SETTEXTEX()
...
@@ -972,6 +972,96 @@ static void test_EM_SETTEXTEX()
}
}
static
void
test_EM_EXLIMITTEXT
(
void
)
{
int
i
,
selBegin
,
selEnd
,
len1
,
len2
;
int
BUFSIZE
=
1024
;
char
text
[
BUFSIZE
+
1
];
int
textlimit
=
0
;
/* multiple of 100 */
HWND
hwndRichEdit
=
new_richedit
(
NULL
);
i
=
SendMessage
(
hwndRichEdit
,
EM_GETLIMITTEXT
,
0
,
0
);
ok
(
32767
==
i
,
"EM_EXLIMITTEXT: expected: %d, actual: %d
\n
"
,
32767
,
i
);
/* default */
textlimit
=
256000
;
SendMessage
(
hwndRichEdit
,
EM_EXLIMITTEXT
,
0
,
textlimit
);
i
=
SendMessage
(
hwndRichEdit
,
EM_GETLIMITTEXT
,
0
,
0
);
/* set higher */
ok
(
textlimit
==
i
,
"EM_EXLIMITTEXT: expected: %d, actual: %d
\n
"
,
textlimit
,
i
);
textlimit
=
1000
;
SendMessage
(
hwndRichEdit
,
EM_EXLIMITTEXT
,
0
,
textlimit
);
i
=
SendMessage
(
hwndRichEdit
,
EM_GETLIMITTEXT
,
0
,
0
);
/* set lower */
ok
(
textlimit
==
i
,
"EM_EXLIMITTEXT: expected: %d, actual: %d
\n
"
,
textlimit
,
i
);
SendMessage
(
hwndRichEdit
,
EM_EXLIMITTEXT
,
0
,
0
);
i
=
SendMessage
(
hwndRichEdit
,
EM_GETLIMITTEXT
,
0
,
0
);
/* default for WParam = 0 */
ok
(
65536
==
i
,
"EM_EXLIMITTEXT: expected: %d, actual: %d
\n
"
,
65536
,
i
);
textlimit
=
BUFSIZE
;
memset
(
text
,
'W'
,
textlimit
);
text
[
BUFSIZE
]
=
0
;
SendMessage
(
hwndRichEdit
,
EM_EXLIMITTEXT
,
0
,
textlimit
);
/* maxed out text */
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
text
);
SendMessage
(
hwndRichEdit
,
EM_SETSEL
,
0
,
-
1
);
/* select everything */
SendMessage
(
hwndRichEdit
,
EM_GETSEL
,
(
WPARAM
)
&
selBegin
,
(
LPARAM
)
&
selEnd
);
len1
=
selEnd
-
selBegin
;
SendMessage
(
hwndRichEdit
,
WM_KEYDOWN
,
VK_BACK
,
1
);
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
VK_BACK
,
1
);
SendMessage
(
hwndRichEdit
,
WM_KEYUP
,
VK_BACK
,
1
);
SendMessage
(
hwndRichEdit
,
EM_SETSEL
,
0
,
-
1
);
SendMessage
(
hwndRichEdit
,
EM_GETSEL
,
(
WPARAM
)
&
selBegin
,
(
LPARAM
)
&
selEnd
);
len2
=
selEnd
-
selBegin
;
ok
(
len1
!=
len2
,
"EM_EXLIMITTEXT: Change Expected
\n
Old Length: %d, New Length: %d, Limit: %d
\n
"
,
len1
,
len2
,
i
);
SendMessage
(
hwndRichEdit
,
WM_KEYDOWN
,
'A'
,
1
);
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
'A'
,
1
);
SendMessage
(
hwndRichEdit
,
WM_KEYUP
,
'A'
,
1
);
SendMessage
(
hwndRichEdit
,
EM_SETSEL
,
0
,
-
1
);
SendMessage
(
hwndRichEdit
,
EM_GETSEL
,
(
WPARAM
)
&
selBegin
,
(
LPARAM
)
&
selEnd
);
len1
=
selEnd
-
selBegin
;
ok
(
len1
!=
len2
,
"EM_EXLIMITTEXT: Change Expected
\n
Old Length: %d, New Length: %d, Limit: %d
\n
"
,
len1
,
len2
,
i
);
SendMessage
(
hwndRichEdit
,
WM_KEYDOWN
,
'A'
,
1
);
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
'A'
,
1
);
SendMessage
(
hwndRichEdit
,
WM_KEYUP
,
'A'
,
1
);
/* full; should be no effect */
SendMessage
(
hwndRichEdit
,
EM_SETSEL
,
0
,
-
1
);
SendMessage
(
hwndRichEdit
,
EM_GETSEL
,
(
WPARAM
)
&
selBegin
,
(
LPARAM
)
&
selEnd
);
len2
=
selEnd
-
selBegin
;
ok
(
len1
==
len2
,
"EM_EXLIMITTEXT: No Change Expected
\n
Old Length: %d, New Length: %d, Limit: %d
\n
"
,
len1
,
len2
,
i
);
DestroyWindow
(
hwndRichEdit
);
}
static
void
test_EM_GETLIMITTEXT
(
void
)
{
int
i
;
HWND
hwndRichEdit
=
new_richedit
(
NULL
);
i
=
SendMessage
(
hwndRichEdit
,
EM_GETLIMITTEXT
,
0
,
0
);
ok
(
32767
==
i
,
"expected: %d, actual: %d
\n
"
,
32767
,
i
);
/* default value */
SendMessage
(
hwndRichEdit
,
EM_EXLIMITTEXT
,
0
,
50000
);
i
=
SendMessage
(
hwndRichEdit
,
EM_GETLIMITTEXT
,
0
,
0
);
ok
(
50000
==
i
,
"expected: %d, actual: %d
\n
"
,
50000
,
i
);
DestroyWindow
(
hwndRichEdit
);
}
START_TEST
(
editor
)
START_TEST
(
editor
)
{
{
MSG
msg
;
MSG
msg
;
...
@@ -993,6 +1083,8 @@ START_TEST( editor )
...
@@ -993,6 +1083,8 @@ START_TEST( editor )
test_EM_SETUNDOLIMIT
();
test_EM_SETUNDOLIMIT
();
test_ES_PASSWORD
();
test_ES_PASSWORD
();
test_EM_SETTEXTEX
();
test_EM_SETTEXTEX
();
test_EM_EXLIMITTEXT
();
test_EM_GETLIMITTEXT
();
/* Set the environment variable WINETEST_RICHED20 to keep windows
/* Set the environment variable WINETEST_RICHED20 to keep windows
* responsive and open for 30 seconds. This is useful for debugging.
* responsive and open for 30 seconds. This is useful for debugging.
...
...
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