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
a065d0f6
Commit
a065d0f6
authored
Jan 11, 2007
by
Clinton Stimpson
Committed by
Alexandre Julliard
Jan 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Fix crash undoing a paste.
parent
3456e562
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
11 deletions
+37
-11
editor.c
dlls/riched20/editor.c
+0
-11
editor.c
dlls/riched20/tests/editor.c
+37
-0
No files found.
dlls/riched20/editor.c
View file @
a065d0f6
...
...
@@ -598,7 +598,6 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
RTF_Info
parser
;
ME_Style
*
style
;
int
from
,
to
,
to2
;
ME_UndoItem
*
pUI
;
int
nEventMask
=
editor
->
nEventMask
;
ME_InStream
inStream
;
...
...
@@ -674,16 +673,6 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
if
(
format
&
SFF_SELECTION
)
{
if
(
from
<
to
)
/* selection overwritten is non-empty */
{
pUI
=
ME_AddUndoItem
(
editor
,
diUndoDeleteRun
,
NULL
);
TRACE
(
"from %d to %d
\n
"
,
from
,
to
);
if
(
pUI
)
{
pUI
->
nStart
=
from
;
pUI
->
nLen
=
to
-
from
;
}
}
/* even if we didn't add an undo, we need to commit the ones added earlier */
ME_CommitUndo
(
editor
);
}
...
...
dlls/riched20/tests/editor.c
View file @
a065d0f6
...
...
@@ -22,6 +22,7 @@
#include <windows.h>
#include <richedit.h>
#include <time.h>
#include <stdio.h>
static
HMODULE
hmoduleRichEdit
;
...
...
@@ -1386,6 +1387,41 @@ static void test_EM_EXSETSEL(void)
DestroyWindow
(
hwndRichEdit
);
}
static
void
test_WM_PASTE
(
void
)
{
int
result
;
char
buffer
[
1024
]
=
{
0
};
const
char
*
text1
=
"testing paste
\r
"
;
const
char
*
text2
=
"testing paste
\r\r
testing paste"
;
const
char
*
text3
=
"testing paste
\r
paste
\r
testing paste"
;
HWND
hwndRichEdit
=
new_richedit
(
NULL
);
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
text1
);
SendMessage
(
hwndRichEdit
,
EM_SETSEL
,
0
,
14
);
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
3
,
0
);
/* ctrl-c */
SendMessage
(
hwndRichEdit
,
EM_SETSEL
,
14
,
14
);
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
22
,
0
);
/* ctrl-v */
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
26
,
0
);
/* ctrl-z */
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
result
=
strcmp
(
text1
,
buffer
);
ok
(
result
==
0
,
"test paste: strcmp = %i
\n
"
,
result
);
SendMessage
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
text2
);
SendMessage
(
hwndRichEdit
,
EM_SETSEL
,
8
,
13
);
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
3
,
0
);
/* ctrl-c */
SendMessage
(
hwndRichEdit
,
EM_SETSEL
,
14
,
14
);
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
22
,
0
);
/* ctrl-v */
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
26
,
0
);
/* ctrl-z */
SendMessage
(
hwndRichEdit
,
WM_CHAR
,
25
,
0
);
/* ctrl-y */
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
result
=
strcmp
(
buffer
,
text3
);
ok
(
result
==
0
,
"test paste: strcmp = %i
\n
"
,
result
);
DestroyWindow
(
hwndRichEdit
);
}
START_TEST
(
editor
)
{
MSG
msg
;
...
...
@@ -1412,6 +1448,7 @@ START_TEST( editor )
test_WM_SETFONT
();
test_EM_GETMODIFY
();
test_EM_EXSETSEL
();
test_WM_PASTE
();
/* 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