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
00e56273
Commit
00e56273
authored
Sep 23, 2007
by
Alex Villacís Lasso
Committed by
Alexandre Julliard
Sep 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Fix WM_GETTEXT to change \r to \r\n.
parent
47316d62
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
15 deletions
+11
-15
editor.c
dlls/riched20/editor.c
+8
-5
editor.c
dlls/riched20/tests/editor.c
+3
-10
No files found.
dlls/riched20/editor.c
View file @
00e56273
...
@@ -1983,11 +1983,14 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
...
@@ -1983,11 +1983,14 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
return
ME_GetTextLengthEx
(
editor
,
(
GETTEXTLENGTHEX
*
)
wParam
);
return
ME_GetTextLengthEx
(
editor
,
(
GETTEXTLENGTHEX
*
)
wParam
);
case
WM_GETTEXT
:
case
WM_GETTEXT
:
{
{
TEXTRANGEW
tr
;
/* W and A differ only by rng->lpstrText */
GETTEXTEX
ex
;
tr
.
chrg
.
cpMin
=
0
;
tr
.
chrg
.
cpMax
=
wParam
?
(
wParam
-
1
)
:
0
;
ex
.
cb
=
wParam
;
tr
.
lpstrText
=
(
WCHAR
*
)
lParam
;
ex
.
flags
=
GT_USECRLF
;
return
RichEditWndProc_common
(
hWnd
,
EM_GETTEXTRANGE
,
0
,
(
LPARAM
)
&
tr
,
unicode
);
ex
.
codepage
=
unicode
?
1200
:
CP_ACP
;
ex
.
lpDefaultChar
=
NULL
;
ex
.
lpUsedDefaultChar
=
NULL
;
return
RichEditWndProc_common
(
hWnd
,
EM_GETTEXTEX
,
(
WPARAM
)
&
ex
,
lParam
,
unicode
);
}
}
case
EM_GETTEXTEX
:
case
EM_GETTEXTEX
:
{
{
...
...
dlls/riched20/tests/editor.c
View file @
00e56273
...
@@ -943,10 +943,8 @@ static void test_WM_SETTEXT()
...
@@ -943,10 +943,8 @@ static void test_WM_SETTEXT()
"WM_GETTEXT returned %ld instead of expected %u
\n
"
,
"WM_GETTEXT returned %ld instead of expected %u
\n
"
,
result
,
strlen
(
buf
));
result
,
strlen
(
buf
));
result
=
strcmp
(
TestItem2_after
,
buf
);
result
=
strcmp
(
TestItem2_after
,
buf
);
todo_wine
{
ok
(
result
==
0
,
ok
(
result
==
0
,
"WM_SETTEXT round trip: strcmp = %ld
\n
"
,
result
);
"WM_SETTEXT round trip: strcmp = %ld
\n
"
,
result
);
}
result
=
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
TestItem3
);
result
=
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
TestItem3
);
ok
(
result
==
1
,
"WM_SETTEXT returned %ld instead of 1
\n
"
,
result
);
ok
(
result
==
1
,
"WM_SETTEXT returned %ld instead of 1
\n
"
,
result
);
...
@@ -955,10 +953,8 @@ static void test_WM_SETTEXT()
...
@@ -955,10 +953,8 @@ static void test_WM_SETTEXT()
"WM_GETTEXT returned %ld instead of expected %u
\n
"
,
"WM_GETTEXT returned %ld instead of expected %u
\n
"
,
result
,
strlen
(
buf
));
result
,
strlen
(
buf
));
result
=
strcmp
(
TestItem3_after
,
buf
);
result
=
strcmp
(
TestItem3_after
,
buf
);
todo_wine
{
ok
(
result
==
0
,
ok
(
result
==
0
,
"WM_SETTEXT round trip: strcmp = %ld
\n
"
,
result
);
"WM_SETTEXT round trip: strcmp = %ld
\n
"
,
result
);
}
result
=
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
TestItem3_after
);
result
=
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
TestItem3_after
);
ok
(
result
==
1
,
"WM_SETTEXT returned %ld instead of 1
\n
"
,
result
);
ok
(
result
==
1
,
"WM_SETTEXT returned %ld instead of 1
\n
"
,
result
);
...
@@ -967,10 +963,8 @@ static void test_WM_SETTEXT()
...
@@ -967,10 +963,8 @@ static void test_WM_SETTEXT()
"WM_GETTEXT returned %ld instead of expected %u
\n
"
,
"WM_GETTEXT returned %ld instead of expected %u
\n
"
,
result
,
strlen
(
buf
));
result
,
strlen
(
buf
));
result
=
strcmp
(
TestItem3_after
,
buf
);
result
=
strcmp
(
TestItem3_after
,
buf
);
todo_wine
{
ok
(
result
==
0
,
ok
(
result
==
0
,
"WM_SETTEXT round trip: strcmp = %ld
\n
"
,
result
);
"WM_SETTEXT round trip: strcmp = %ld
\n
"
,
result
);
}
DestroyWindow
(
hwndRichEdit
);
DestroyWindow
(
hwndRichEdit
);
}
}
...
@@ -1020,10 +1014,8 @@ static void test_EM_SETTEXTEX(void)
...
@@ -1020,10 +1014,8 @@ static void test_EM_SETTEXTEX(void)
/* However, WM_GETTEXT *does* see \r\n where EM_GETTEXTEX would see \r */
/* However, WM_GETTEXT *does* see \r\n where EM_GETTEXTEX would see \r */
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
MAX_BUF_LEN
,
(
LPARAM
)
buf
);
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
MAX_BUF_LEN
,
(
LPARAM
)
buf
);
todo_wine
{
ok
(
strcmp
((
const
char
*
)
buf
,
TestItem2_after
)
==
0
,
ok
(
strcmp
((
const
char
*
)
buf
,
TestItem2_after
)
==
0
,
"WM_GETTEXT did *not* see
\\
r converted to
\\
r
\\
n pairs.
\n
"
);
"WM_GETTEXT did *not* see
\\
r converted to
\\
r
\\
n pairs.
\n
"
);
}
result
=
SendMessage
(
hwndRichEdit
,
EM_SETTEXTEX
,
result
=
SendMessage
(
hwndRichEdit
,
EM_SETTEXTEX
,
(
WPARAM
)
&
setText
,
(
LPARAM
)
NULL
);
(
WPARAM
)
&
setText
,
(
LPARAM
)
NULL
);
...
@@ -1616,8 +1608,9 @@ static void test_WM_PASTE(void)
...
@@ -1616,8 +1608,9 @@ static void test_WM_PASTE(void)
int
result
;
int
result
;
char
buffer
[
1024
]
=
{
0
};
char
buffer
[
1024
]
=
{
0
};
const
char
*
text1
=
"testing paste
\r
"
;
const
char
*
text1
=
"testing paste
\r
"
;
const
char
*
text1_after
=
"testing paste
\r\n
"
;
const
char
*
text2
=
"testing paste
\r\r
testing paste"
;
const
char
*
text2
=
"testing paste
\r\r
testing paste"
;
const
char
*
text3
=
"testing paste
\r
paste
\r
testing paste"
;
const
char
*
text3
=
"testing paste
\r
\n
paste
\r\n
testing paste"
;
HWND
hwndRichEdit
=
new_richedit
(
NULL
);
HWND
hwndRichEdit
=
new_richedit
(
NULL
);
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
text1
);
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
text1
);
...
@@ -1627,7 +1620,7 @@ static void test_WM_PASTE(void)
...
@@ -1627,7 +1620,7 @@ static void test_WM_PASTE(void)
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
22
,
0
);
/* ctrl-v */
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
22
,
0
);
/* ctrl-v */
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
26
,
0
);
/* ctrl-z */
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
26
,
0
);
/* ctrl-z */
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
result
=
strcmp
(
text1
,
buffer
);
result
=
strcmp
(
text1
_after
,
buffer
);
ok
(
result
==
0
,
ok
(
result
==
0
,
"test paste: strcmp = %i
\n
"
,
result
);
"test paste: strcmp = %i
\n
"
,
result
);
...
...
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