From bc3e38ca3a4228b7191e9fec39288c9f37ec53b1 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 6 Jan 2021 12:25:35 +0100 Subject: Cleanup/refactor: UndoType: Clarify `use_context` variable. Rename it to mark it is only for `encode` callbacks, fix `encode` callback of text undo to early fail in case it gets a NULL context, add an assert to `BKE_undosys_step_push_with_type` that context is not NULL when undotype requires a valid one. Note that in practice this should not change anything, currently it seems that we always get a valid context in `BKE_undosys_step_push_with_type`? --- source/blender/editors/curve/editcurve_undo.c | 2 +- source/blender/editors/curve/editfont_undo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/curve') diff --git a/source/blender/editors/curve/editcurve_undo.c b/source/blender/editors/curve/editcurve_undo.c index 1fd1e217649..3fd3a348426 100644 --- a/source/blender/editors/curve/editcurve_undo.c +++ b/source/blender/editors/curve/editcurve_undo.c @@ -309,7 +309,7 @@ void ED_curve_undosys_type(UndoType *ut) ut->step_foreach_ID_ref = curve_undosys_foreach_ID_ref; - ut->use_context = true; + ut->use_context_for_encode = true; ut->step_size = sizeof(CurveUndoStep); } diff --git a/source/blender/editors/curve/editfont_undo.c b/source/blender/editors/curve/editfont_undo.c index 61c05f62af7..895db2b4ad1 100644 --- a/source/blender/editors/curve/editfont_undo.c +++ b/source/blender/editors/curve/editfont_undo.c @@ -398,7 +398,7 @@ void ED_font_undosys_type(UndoType *ut) ut->step_foreach_ID_ref = font_undosys_foreach_ID_ref; - ut->use_context = true; + ut->use_context_for_encode = true; ut->step_size = sizeof(FontUndoStep); } -- cgit v1.2.3