Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_text/text_undo.c
| Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | |||||
| static bool text_undosys_poll(bContext *UNUSED(C)) | static bool text_undosys_poll(bContext *UNUSED(C)) | ||||
| { | { | ||||
| /* Only use when operators initialized. */ | /* Only use when operators initialized. */ | ||||
| UndoStack *ustack = ED_undo_stack_get(); | UndoStack *ustack = ED_undo_stack_get(); | ||||
| return (ustack->step_init && (ustack->step_init->type == BKE_UNDOSYS_TYPE_TEXT)); | return (ustack->step_init && (ustack->step_init->type == BKE_UNDOSYS_TYPE_TEXT)); | ||||
| } | } | ||||
| static void text_undosys_step_encode_init(struct bContext *C, UndoStep *us_p) | static void text_undosys_step_encode_init(const struct bContext *C, UndoStep *us_p) | ||||
| { | { | ||||
| TextUndoStep *us = (TextUndoStep *)us_p; | TextUndoStep *us = (TextUndoStep *)us_p; | ||||
| BLI_assert(BLI_array_is_zeroed(us->states, ARRAY_SIZE(us->states))); | BLI_assert(BLI_array_is_zeroed(us->states, ARRAY_SIZE(us->states))); | ||||
| Text *text = CTX_data_edit_text(C); | Text *text = CTX_data_edit_text(C); | ||||
| /* Avoid writing the initial state where possible, | /* Avoid writing the initial state where possible, | ||||
| * failing to do this won't cause bugs, it's just inefficient. */ | * failing to do this won't cause bugs, it's just inefficient. */ | ||||
| ▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines | |||||