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
bf86302e
Commit
bf86302e
authored
Jan 11, 2007
by
Clinton Stimpson
Committed by
Alexandre Julliard
Jan 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Fix modification state for several operations.
parent
bbedf3d0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
12 deletions
+9
-12
caret.c
dlls/riched20/caret.c
+3
-0
editor.c
dlls/riched20/editor.c
+6
-1
editor.c
dlls/riched20/tests/editor.c
+0
-8
undo.c
dlls/riched20/undo.c
+0
-3
No files found.
dlls/riched20/caret.c
View file @
bf86302e
...
...
@@ -435,6 +435,9 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
/* Didn't affect performance for WM_SETTEXT (around 50sec/30K) */
int
freeSpace
=
editor
->
nTextLimit
-
ME_GetTextLength
(
editor
);
/* text operations set modified state */
editor
->
nModifyStep
=
1
;
assert
(
style
);
/* FIXME really HERE ? */
...
...
dlls/riched20/editor.c
View file @
bf86302e
...
...
@@ -1639,6 +1639,7 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
size_t
len
=
wszText
?
lstrlenW
(
wszText
)
:
0
;
int
from
,
to
;
ME_Style
*
style
;
int
oldModify
=
editor
->
nModifyStep
;
TRACE
(
"EM_SETTEXTEX - %s, flags %d, cp %d
\n
"
,
debugstr_w
(
wszText
),
(
int
)
pStruct
->
flags
,
pStruct
->
codepage
);
if
(
pStruct
->
codepage
!=
1200
)
{
FIXME
(
"EM_SETTEXTEX only supports unicode right now!
\n
"
);
...
...
@@ -1659,7 +1660,10 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
}
ME_CommitUndo
(
editor
);
if
(
!
(
pStruct
->
flags
&
ST_KEEPUNDO
))
{
editor
->
nModifyStep
=
oldModify
;
ME_EmptyUndoStack
(
editor
);
}
ME_UpdateRepaint
(
editor
);
return
len
;
}
...
...
@@ -1690,7 +1694,7 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
case
EM_SETMODIFY
:
{
if
(
wParam
)
editor
->
nModifyStep
=
0x80000000
;
editor
->
nModifyStep
=
1
;
else
editor
->
nModifyStep
=
0
;
...
...
@@ -1732,6 +1736,7 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
bRepaint
=
(
from
!=
to
);
ME_SetSelectionCharFormat
(
editor
,
p
);
}
editor
->
nModifyStep
=
1
;
ME_CommitUndo
(
editor
);
if
(
bRepaint
)
ME_RewrapRepaint
(
editor
);
...
...
dlls/riched20/tests/editor.c
View file @
bf86302e
...
...
@@ -1192,10 +1192,8 @@ static void test_EM_GETMODIFY(void)
SendMessage
(
hwndRichEdit
,
EM_SETMODIFY
,
FALSE
,
0
);
SendMessage
(
hwndRichEdit
,
WM_SETFONT
,
(
WPARAM
)
testFont
,(
LPARAM
)
MAKELONG
((
WORD
)
TRUE
,
0
));
result
=
SendMessage
(
hwndRichEdit
,
EM_GETMODIFY
,
0
,
0
);
todo_wine
{
ok
(
result
==
0
,
"EM_GETMODIFY returned non-zero, instead of zero on setting font
\n
"
);
}
/* setting text should set modify flag */
SendMessage
(
hwndRichEdit
,
EM_SETMODIFY
,
FALSE
,
0
);
...
...
@@ -1207,20 +1205,16 @@ static void test_EM_GETMODIFY(void)
/* undo previous text doesn't reset modify flag */
SendMessage
(
hwndRichEdit
,
WM_UNDO
,
0
,
0
);
result
=
SendMessage
(
hwndRichEdit
,
EM_GETMODIFY
,
0
,
0
);
todo_wine
{
ok
(
result
!=
0
,
"EM_GETMODIFY returned zero, instead of non-zero on undo after setting text
\n
"
);
}
/* set text with no flag to keep undo stack should not set modify flag */
SendMessage
(
hwndRichEdit
,
EM_SETMODIFY
,
FALSE
,
0
);
setText
.
flags
=
0
;
SendMessage
(
hwndRichEdit
,
EM_SETTEXTEX
,
(
WPARAM
)
&
setText
,
(
LPARAM
)
TestItem1
);
result
=
SendMessage
(
hwndRichEdit
,
EM_GETMODIFY
,
0
,
0
);
todo_wine
{
ok
(
result
==
0
,
"EM_GETMODIFY returned non-zero, instead of zero when setting text while not keeping undo stack
\n
"
);
}
/* WM_SETTEXT doesn't modify */
SendMessage
(
hwndRichEdit
,
EM_SETMODIFY
,
FALSE
,
0
);
...
...
@@ -1295,10 +1289,8 @@ static void test_EM_GETMODIFY(void)
pf2
.
wAlignment
=
PFA_RIGHT
;
SendMessage
(
hwndRichEdit
,
EM_SETPARAFORMAT
,
0
,
(
LPARAM
)
&
pf2
);
result
=
SendMessage
(
hwndRichEdit
,
EM_GETMODIFY
,
0
,
0
);
todo_wine
{
ok
(
result
==
0
,
"EM_GETMODIFY returned zero, instead of non-zero for EM_SETPARAFORMAT
\n
"
);
}
/* EM_STREAM */
SendMessage
(
hwndRichEdit
,
EM_SETMODIFY
,
FALSE
,
0
);
...
...
dlls/riched20/undo.c
View file @
bf86302e
...
...
@@ -163,7 +163,6 @@ void ME_CommitUndo(ME_TextEditor *editor) {
ME_AddUndoItem
(
editor
,
diUndoEndTransaction
,
NULL
);
ME_SendSelChange
(
editor
);
editor
->
nModifyStep
++
;
}
void
ME_PlayUndoItem
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
pItem
)
...
...
@@ -260,7 +259,6 @@ void ME_Undo(ME_TextEditor *editor) {
if
(
p
)
p
->
prev
=
NULL
;
editor
->
nUndoMode
=
nMode
;
editor
->
nModifyStep
--
;
ME_UpdateRepaint
(
editor
);
}
...
...
@@ -293,6 +291,5 @@ void ME_Redo(ME_TextEditor *editor) {
if
(
p
)
p
->
prev
=
NULL
;
editor
->
nUndoMode
=
nMode
;
editor
->
nModifyStep
++
;
ME_UpdateRepaint
(
editor
);
}
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