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
0cd86e01
Commit
0cd86e01
authored
Jun 28, 2022
by
Jinoh Kang
Committed by
Alexandre Julliard
Jul 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Factor out undo-ignored status check.
Signed-off-by:
Jinoh Kang
<
jinoh.kang.kr@gmail.com
>
parent
41d16358
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
editor.h
dlls/riched20/editor.h
+5
-0
undo.c
dlls/riched20/undo.c
+8
-8
No files found.
dlls/riched20/editor.h
View file @
0cd86e01
...
...
@@ -394,6 +394,11 @@ BOOL ME_Undo(ME_TextEditor *editor) DECLSPEC_HIDDEN;
BOOL
ME_Redo
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
void
ME_EmptyUndoStack
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
static
inline
BOOL
editor_undo_ignored
(
ME_TextEditor
*
editor
)
{
return
editor
->
nUndoMode
==
umIgnore
;
}
/* txtsrv.c */
HRESULT
create_text_services
(
IUnknown
*
outer
,
ITextHost
*
text_host
,
IUnknown
**
unk
,
BOOL
emulate_10
)
DECLSPEC_HIDDEN
;
#ifdef __ASM_USE_THISCALL_WRAPPER
...
...
dlls/riched20/undo.c
View file @
0cd86e01
...
...
@@ -53,7 +53,7 @@ static void empty_redo_stack(ME_TextEditor *editor)
void
ME_EmptyUndoStack
(
ME_TextEditor
*
editor
)
{
struct
undo_item
*
cursor
,
*
cursor2
;
if
(
editor
->
nUndoMode
==
umIgnore
)
if
(
editor
->
nUndoMode
==
umIgnore
)
/* NOTE don't use editor_undo_ignored() here! */
return
;
TRACE
(
"Emptying undo stack
\n
"
);
...
...
@@ -74,7 +74,7 @@ static struct undo_item *add_undo( ME_TextEditor *editor, enum undo_type type )
struct
undo_item
*
undo
,
*
item
;
struct
list
*
head
;
if
(
editor
->
nUndoMode
==
umIgnore
)
return
NULL
;
if
(
editor
_undo_ignored
(
editor
)
)
return
NULL
;
if
(
editor
->
nUndoLimit
==
0
)
return
NULL
;
undo
=
heap_alloc
(
sizeof
(
*
undo
)
);
...
...
@@ -229,7 +229,7 @@ void ME_CommitUndo(ME_TextEditor *editor)
struct
undo_item
*
item
;
struct
list
*
head
;
if
(
editor
->
nUndoMode
==
umIgnore
)
if
(
editor
_undo_ignored
(
editor
)
)
return
;
assert
(
editor
->
nUndoMode
==
umAddToUndo
);
...
...
@@ -267,7 +267,7 @@ void ME_ContinueCoalescingTransaction(ME_TextEditor *editor)
struct
undo_item
*
item
;
struct
list
*
head
;
if
(
editor
->
nUndoMode
==
umIgnore
)
if
(
editor
_undo_ignored
(
editor
)
)
return
;
assert
(
editor
->
nUndoMode
==
umAddToUndo
);
...
...
@@ -303,7 +303,7 @@ void ME_CommitCoalescingUndo(ME_TextEditor *editor)
struct
undo_item
*
item
;
struct
list
*
head
;
if
(
editor
->
nUndoMode
==
umIgnore
)
if
(
editor
_undo_ignored
(
editor
)
)
return
;
assert
(
editor
->
nUndoMode
==
umAddToUndo
);
...
...
@@ -323,7 +323,7 @@ void ME_CommitCoalescingUndo(ME_TextEditor *editor)
static
void
ME_PlayUndoItem
(
ME_TextEditor
*
editor
,
struct
undo_item
*
undo
)
{
if
(
editor
->
nUndoMode
==
umIgnore
)
if
(
editor
_undo_ignored
(
editor
)
)
return
;
TRACE
(
"Playing undo/redo item, id=%d
\n
"
,
undo
->
type
);
...
...
@@ -413,7 +413,7 @@ BOOL ME_Undo(ME_TextEditor *editor)
struct
list
*
head
;
struct
undo_item
*
undo
,
*
cursor2
;
if
(
editor
->
nUndoMode
==
umIgnore
)
return
FALSE
;
if
(
editor
_undo_ignored
(
editor
)
)
return
FALSE
;
assert
(
nMode
==
umAddToUndo
||
nMode
==
umIgnore
);
head
=
list_head
(
&
editor
->
undo_stack
);
...
...
@@ -453,7 +453,7 @@ BOOL ME_Redo(ME_TextEditor *editor)
assert
(
nMode
==
umAddToUndo
||
nMode
==
umIgnore
);
if
(
editor
->
nUndoMode
==
umIgnore
)
return
FALSE
;
if
(
editor
_undo_ignored
(
editor
)
)
return
FALSE
;
head
=
list_head
(
&
editor
->
redo_stack
);
if
(
!
head
)
return
FALSE
;
...
...
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