2 * Copyright 2006-2112, Stephan Aßmus <superstippi@gmx.de>
3 * Distributed under the terms of the MIT License.
6 #include "CompoundEdit.h"
11 CompoundEdit::CompoundEdit(const char* name
)
19 CompoundEdit::~CompoundEdit()
25 CompoundEdit::InitCheck()
32 CompoundEdit::Perform(EditContext
& context
)
34 status_t status
= B_OK
;
36 int32 count
= fEdits
.CountItems();
38 for (; i
< count
; i
++) {
39 status
= fEdits
.ItemAtFast(i
)->Perform(context
);
48 fEdits
.ItemAtFast(i
)->Undo(context
);
57 CompoundEdit::Undo(EditContext
& context
)
59 status_t status
= B_OK
;
61 int32 count
= fEdits
.CountItems();
64 status
= fEdits
.ItemAtFast(i
)->Undo(context
);
72 for (; i
< count
; i
++) {
73 fEdits
.ItemAtFast(i
)->Redo(context
);
82 CompoundEdit::Redo(EditContext
& context
)
84 status_t status
= B_OK
;
86 int32 count
= fEdits
.CountItems();
88 for (; i
< count
; i
++) {
89 status
= fEdits
.ItemAtFast(i
)->Redo(context
);
98 fEdits
.ItemAtFast(i
)->Undo(context
);
107 CompoundEdit::GetName(BString
& name
)
114 CompoundEdit::AppendEdit(const UndoableEditRef
& edit
)
116 return fEdits
.Add(edit
);