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
3b636b58
Commit
3b636b58
authored
Dec 06, 2007
by
Alex Villacís Lasso
Committed by
Alexandre Julliard
Dec 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: EM_GETTEXTLENGTHEX must not count last paragraph break if GTL_USECRLF.
parent
b8e10c75
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
3 deletions
+41
-3
caret.c
dlls/riched20/caret.c
+1
-1
editor.c
dlls/riched20/tests/editor.c
+40
-2
No files found.
dlls/riched20/caret.c
View file @
3b636b58
...
@@ -59,7 +59,7 @@ int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how)
...
@@ -59,7 +59,7 @@ int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how)
length
=
ME_GetTextLength
(
editor
);
length
=
ME_GetTextLength
(
editor
);
if
((
GetWindowLongW
(
editor
->
hWnd
,
GWL_STYLE
)
&
ES_MULTILINE
)
&&
(
how
->
flags
&
GTL_USECRLF
))
if
((
GetWindowLongW
(
editor
->
hWnd
,
GWL_STYLE
)
&
ES_MULTILINE
)
&&
(
how
->
flags
&
GTL_USECRLF
))
length
+=
editor
->
nParagraphs
;
length
+=
editor
->
nParagraphs
-
1
;
if
(
how
->
flags
&
GTL_NUMBYTES
)
if
(
how
->
flags
&
GTL_NUMBYTES
)
{
{
...
...
dlls/riched20/tests/editor.c
View file @
3b636b58
...
@@ -2504,8 +2504,10 @@ static void test_EM_GETTEXTLENGTHEX(void)
...
@@ -2504,8 +2504,10 @@ static void test_EM_GETTEXTLENGTHEX(void)
HWND
hwnd
;
HWND
hwnd
;
GETTEXTLENGTHEX
gtl
;
GETTEXTLENGTHEX
gtl
;
int
ret
;
int
ret
;
const
char
*
base_string
=
"base string"
;
const
char
*
test_string
=
"a
\n
b
\n\n\r\n
"
;
const
char
*
test_string
=
"a
\n
b
\n\n\r\n
"
;
const
char
*
test_string_after
=
"a"
;
const
char
*
test_string_after
=
"a"
;
const
char
*
test_string_2
=
"a
\r
test
\r
string"
;
char
buffer
[
64
]
=
{
0
};
char
buffer
[
64
]
=
{
0
};
/* single line */
/* single line */
...
@@ -2523,6 +2525,18 @@ static void test_EM_GETTEXTLENGTHEX(void)
...
@@ -2523,6 +2525,18 @@ static void test_EM_GETTEXTLENGTHEX(void)
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
0
,
"ret %d
\n
"
,
ret
);
ok
(
ret
==
0
,
"ret %d
\n
"
,
ret
);
SendMessage
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
base_string
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
|
GTL_USECRLF
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
strlen
(
base_string
),
"ret %d
\n
"
,
ret
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
strlen
(
base_string
),
"ret %d
\n
"
,
ret
);
SendMessage
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_string
);
SendMessage
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_string
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
|
GTL_USECRLF
;
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
|
GTL_USECRLF
;
...
@@ -2549,19 +2563,43 @@ static void test_EM_GETTEXTLENGTHEX(void)
...
@@ -2549,19 +2563,43 @@ static void test_EM_GETTEXTLENGTHEX(void)
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
|
GTL_USECRLF
;
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
|
GTL_USECRLF
;
gtl
.
codepage
=
CP_ACP
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
todo_wine
ok
(
ret
==
0
,
"ret %d
\n
"
,
ret
);
ok
(
ret
==
0
,
"ret %d
\n
"
,
ret
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
;
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
;
gtl
.
codepage
=
CP_ACP
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
0
,
"ret %d
\n
"
,
ret
);
ok
(
ret
==
0
,
"ret %d
\n
"
,
ret
);
SendMessage
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
base_string
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
|
GTL_USECRLF
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
strlen
(
base_string
),
"ret %d
\n
"
,
ret
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
strlen
(
base_string
),
"ret %d
\n
"
,
ret
);
SendMessage
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_string_2
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
|
GTL_USECRLF
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
strlen
(
test_string_2
)
+
2
,
"ret %d
\n
"
,
ret
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
strlen
(
test_string_2
),
"ret %d
\n
"
,
ret
);
SendMessage
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_string
);
SendMessage
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_string
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
|
GTL_USECRLF
;
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
|
GTL_USECRLF
;
gtl
.
codepage
=
CP_ACP
;
gtl
.
codepage
=
CP_ACP
;
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
todo_wine
ok
(
ret
==
10
,
"ret %d
\n
"
,
ret
);
ok
(
ret
==
10
,
"ret %d
\n
"
,
ret
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
;
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
;
gtl
.
codepage
=
CP_ACP
;
gtl
.
codepage
=
CP_ACP
;
...
...
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