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
0dcebea4
Commit
0dcebea4
authored
Aug 15, 2007
by
Huw Davies
Committed by
Alexandre Julliard
Aug 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Add some test for EM_GETTEXTLENGTHEX and fix the single line edit cases.
parent
ce26e78c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
2 deletions
+69
-2
caret.c
dlls/riched20/caret.c
+2
-2
editor.c
dlls/riched20/tests/editor.c
+67
-0
No files found.
dlls/riched20/caret.c
View file @
0dcebea4
...
...
@@ -57,8 +57,8 @@ int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how)
return
E_INVALIDARG
;
length
=
ME_GetTextLength
(
editor
);
if
(
how
->
flags
&
GTL_USECRLF
)
if
(
(
GetWindowLongW
(
editor
->
hWnd
,
GWL_STYLE
)
&
ES_MULTILINE
)
&&
(
how
->
flags
&
GTL_USECRLF
)
)
length
+=
editor
->
nParagraphs
;
if
(
how
->
flags
&
GTL_NUMBYTES
)
...
...
dlls/riched20/tests/editor.c
View file @
0dcebea4
...
...
@@ -1823,6 +1823,72 @@ static void test_unicode_conversions(void)
DestroyWindow
(
hwnd
);
}
static
void
test_EM_GETTEXTLENGTHEX
(
void
)
{
HWND
hwnd
;
GETTEXTLENGTHEX
gtl
;
int
ret
;
/* single line */
hwnd
=
CreateWindowExA
(
0
,
"RichEdit20W"
,
NULL
,
WS_POPUP
,
0
,
0
,
200
,
60
,
0
,
0
,
0
,
0
);
ok
(
hwnd
!=
0
,
"CreateWindowExA error %u
\n
"
,
GetLastError
());
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
|
GTL_USECRLF
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
0
,
"ret %d
\n
"
,
ret
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
0
,
"ret %d
\n
"
,
ret
);
SendMessage
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
"a
\n
b
\n\n\r\n
"
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
|
GTL_USECRLF
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
todo_wine
ok
(
ret
==
1
,
"ret %d
\n
"
,
ret
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
todo_wine
ok
(
ret
==
1
,
"ret %d
\n
"
,
ret
);
DestroyWindow
(
hwnd
);
/* multi line */
hwnd
=
CreateWindowExA
(
0
,
"RichEdit20W"
,
NULL
,
WS_POPUP
|
ES_MULTILINE
,
0
,
0
,
200
,
60
,
0
,
0
,
0
,
0
);
ok
(
hwnd
!=
0
,
"CreateWindowExA error %u
\n
"
,
GetLastError
());
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
|
GTL_USECRLF
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
todo_wine
ok
(
ret
==
0
,
"ret %d
\n
"
,
ret
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
0
,
"ret %d
\n
"
,
ret
);
SendMessage
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
"a
\n
b
\n\n\r\n
"
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
|
GTL_USECRLF
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
todo_wine
ok
(
ret
==
10
,
"ret %d
\n
"
,
ret
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
6
,
"ret %d
\n
"
,
ret
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
editor
)
{
MSG
msg
;
...
...
@@ -1855,6 +1921,7 @@ START_TEST( editor )
test_EM_StreamIn_Undo
();
test_EM_FORMATRANGE
();
test_unicode_conversions
();
test_EM_GETTEXTLENGTHEX
();
/* Set the environment variable WINETEST_RICHED20 to keep windows
* 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