diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/armature/editarmature_undo.c | 3 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve_undo.c | 6 | ||||
-rw-r--r-- | source/blender/editors/curve/editfont_undo.c | 3 | ||||
-rw-r--r-- | source/blender/editors/lattice/editlattice_undo.c | 3 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_undo.c | 3 | ||||
-rw-r--r-- | source/blender/editors/metaball/editmball_undo.c | 3 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_edit_undo.c | 3 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_curve_undo.c | 3 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_undo.c | 6 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_undo.c | 15 | ||||
-rw-r--r-- | source/blender/editors/undo/memfile_undo.c | 6 |
13 files changed, 35 insertions, 35 deletions
diff --git a/source/blender/editors/armature/editarmature_undo.c b/source/blender/editors/armature/editarmature_undo.c index 3a2440af2da..4a82a8fccee 100644 --- a/source/blender/editors/armature/editarmature_undo.c +++ b/source/blender/editors/armature/editarmature_undo.c @@ -174,7 +174,8 @@ static bool armature_undosys_step_encode(struct bContext *C, static void armature_undosys_step_decode(struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p, - int UNUSED(dir)) + int UNUSED(dir), + bool UNUSED(is_final)) { ArmatureUndoStep *us = (ArmatureUndoStep *)us_p; diff --git a/source/blender/editors/curve/editcurve_undo.c b/source/blender/editors/curve/editcurve_undo.c index d0c2afcb1d2..835abd1a630 100644 --- a/source/blender/editors/curve/editcurve_undo.c +++ b/source/blender/editors/curve/editcurve_undo.c @@ -238,10 +238,8 @@ static bool curve_undosys_step_encode(struct bContext *C, return true; } -static void curve_undosys_step_decode(struct bContext *C, - struct Main *bmain, - UndoStep *us_p, - int UNUSED(dir)) +static void curve_undosys_step_decode( + struct bContext *C, struct Main *bmain, UndoStep *us_p, int UNUSED(dir), bool UNUSED(is_final)) { CurveUndoStep *us = (CurveUndoStep *)us_p; diff --git a/source/blender/editors/curve/editfont_undo.c b/source/blender/editors/curve/editfont_undo.c index 82c19db7a4a..8f8c23a7772 100644 --- a/source/blender/editors/curve/editfont_undo.c +++ b/source/blender/editors/curve/editfont_undo.c @@ -356,7 +356,8 @@ static bool font_undosys_step_encode(struct bContext *C, static void font_undosys_step_decode(struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p, - int UNUSED(dir)) + int UNUSED(dir), + bool UNUSED(is_final)) { /* TODO(campbell): undo_system: use low-level API to set mode. */ ED_object_mode_set(C, OB_MODE_EDIT); diff --git a/source/blender/editors/lattice/editlattice_undo.c b/source/blender/editors/lattice/editlattice_undo.c index 166201adc15..5164970198e 100644 --- a/source/blender/editors/lattice/editlattice_undo.c +++ b/source/blender/editors/lattice/editlattice_undo.c @@ -176,7 +176,8 @@ static bool lattice_undosys_step_encode(struct bContext *C, static void lattice_undosys_step_decode(struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p, - int UNUSED(dir)) + int UNUSED(dir), + bool UNUSED(is_final)) { LatticeUndoStep *us = (LatticeUndoStep *)us_p; diff --git a/source/blender/editors/mesh/editmesh_undo.c b/source/blender/editors/mesh/editmesh_undo.c index 28b14b0060d..e823fb46140 100644 --- a/source/blender/editors/mesh/editmesh_undo.c +++ b/source/blender/editors/mesh/editmesh_undo.c @@ -741,7 +741,8 @@ static bool mesh_undosys_step_encode(struct bContext *C, static void mesh_undosys_step_decode(struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p, - int UNUSED(dir)) + int UNUSED(dir), + bool UNUSED(is_final)) { MeshUndoStep *us = (MeshUndoStep *)us_p; diff --git a/source/blender/editors/metaball/editmball_undo.c b/source/blender/editors/metaball/editmball_undo.c index d255fac26ad..9a95560ccdd 100644 --- a/source/blender/editors/metaball/editmball_undo.c +++ b/source/blender/editors/metaball/editmball_undo.c @@ -185,7 +185,8 @@ static bool mball_undosys_step_encode(struct bContext *C, static void mball_undosys_step_decode(struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p, - int UNUSED(dir)) + int UNUSED(dir), + bool UNUSED(is_final)) { MBallUndoStep *us = (MBallUndoStep *)us_p; diff --git a/source/blender/editors/physics/particle_edit_undo.c b/source/blender/editors/physics/particle_edit_undo.c index be625eb939f..40d90676487 100644 --- a/source/blender/editors/physics/particle_edit_undo.c +++ b/source/blender/editors/physics/particle_edit_undo.c @@ -252,7 +252,8 @@ static bool particle_undosys_step_encode(struct bContext *C, static void particle_undosys_step_decode(struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p, - int UNUSED(dir)) + int UNUSED(dir), + bool UNUSED(is_final)) { /* TODO(campbell): undo_system: use low-level API to set mode. */ ED_object_mode_set(C, OB_MODE_PARTICLE_EDIT); diff --git a/source/blender/editors/sculpt_paint/paint_curve_undo.c b/source/blender/editors/sculpt_paint/paint_curve_undo.c index c03cb69df88..7e283274383 100644 --- a/source/blender/editors/sculpt_paint/paint_curve_undo.c +++ b/source/blender/editors/sculpt_paint/paint_curve_undo.c @@ -122,7 +122,8 @@ static bool paintcurve_undosys_step_encode(struct bContext *C, static void paintcurve_undosys_step_decode(struct bContext *UNUSED(C), struct Main *UNUSED(bmain), UndoStep *us_p, - int UNUSED(dir)) + int UNUSED(dir), + bool UNUSED(is_final)) { PaintCurveUndoStep *us = (PaintCurveUndoStep *)us_p; undocurve_to_paintcurve(&us->data, us->pc); diff --git a/source/blender/editors/sculpt_paint/paint_image_undo.c b/source/blender/editors/sculpt_paint/paint_image_undo.c index bb73d424152..e7f100ebacb 100644 --- a/source/blender/editors/sculpt_paint/paint_image_undo.c +++ b/source/blender/editors/sculpt_paint/paint_image_undo.c @@ -540,10 +540,8 @@ static void image_undosys_step_decode_redo(ImageUndoStep *us) } } -static void image_undosys_step_decode(struct bContext *C, - struct Main *bmain, - UndoStep *us_p, - int dir) +static void image_undosys_step_decode( + struct bContext *C, struct Main *bmain, UndoStep *us_p, int dir, bool UNUSED(is_final)) { ImageUndoStep *us = (ImageUndoStep *)us_p; #if 0 diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index a20fe375ec7..81bb9c35817 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -1109,10 +1109,8 @@ static void sculpt_undosys_step_decode_redo(struct bContext *C, SculptUndoStep * } } -static void sculpt_undosys_step_decode(struct bContext *C, - struct Main *bmain, - UndoStep *us_p, - int dir) +static void sculpt_undosys_step_decode( + struct bContext *C, struct Main *bmain, UndoStep *us_p, int dir, bool UNUSED(is_final)) { /* Ensure sculpt mode. */ { diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 63d4f3e3119..33bacb0a95f 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -932,7 +932,7 @@ static void txt_copy_clipboard(Text *text) return; } - buf = txt_sel_to_buf(text); + buf = txt_sel_to_buf(text, NULL); if (buf) { WM_clipboard_text_set(buf, 0); @@ -2994,7 +2994,7 @@ static void text_cursor_set_exit(bContext *C, wmOperator *op) char *buffer; if (txt_has_sel(text)) { - buffer = txt_sel_to_buf(text); + buffer = txt_sel_to_buf(text, NULL); WM_clipboard_text_set(buffer, 1); MEM_freeN(buffer); } @@ -3308,7 +3308,7 @@ static int text_find_and_replace(bContext *C, wmOperator *op, short mode) /* Replace current */ if (mode != TEXT_FIND && txt_has_sel(text)) { - tmp = txt_sel_to_buf(text); + tmp = txt_sel_to_buf(text, NULL); if (flags & ST_MATCH_CASE) { found = STREQ(st->findstr, tmp); @@ -3406,7 +3406,7 @@ static int text_find_set_selected_exec(bContext *C, wmOperator *op) Text *text = CTX_data_edit_text(C); char *tmp; - tmp = txt_sel_to_buf(text); + tmp = txt_sel_to_buf(text, NULL); BLI_strncpy(st->findstr, tmp, ST_MAX_FIND_STR); MEM_freeN(tmp); @@ -3437,7 +3437,7 @@ static int text_replace_set_selected_exec(bContext *C, wmOperator *UNUSED(op)) Text *text = CTX_data_edit_text(C); char *tmp; - tmp = txt_sel_to_buf(text); + tmp = txt_sel_to_buf(text, NULL); BLI_strncpy(st->replacestr, tmp, ST_MAX_FIND_STR); MEM_freeN(tmp); diff --git a/source/blender/editors/space_text/text_undo.c b/source/blender/editors/space_text/text_undo.c index 7710c5637a2..66cbaa8bb5b 100644 --- a/source/blender/editors/space_text/text_undo.c +++ b/source/blender/editors/space_text/text_undo.c @@ -130,7 +130,7 @@ static void text_undosys_step_decode_redo_impl(Text *text, TextUndoStep *us) us->step.is_applied = true; } -static void text_undosys_step_decode_undo(TextUndoStep *us) +static void text_undosys_step_decode_undo(TextUndoStep *us, bool is_final) { TextUndoStep *us_iter = us; while (us_iter->step.next && (us_iter->step.next->type == us_iter->step.type)) { @@ -140,13 +140,16 @@ static void text_undosys_step_decode_undo(TextUndoStep *us) us_iter = (TextUndoStep *)us_iter->step.next; } Text *text_prev = NULL; - while (us_iter != us) { + while ((us_iter != us) || (is_final && us_iter == us)) { Text *text = us_iter->text_ref.ptr; text_undosys_step_decode_undo_impl(text, us_iter); if (text_prev != text) { text_update_edited(text); text_prev = text; } + if (is_final) { + break; + } us_iter = (TextUndoStep *)us_iter->step.prev; } } @@ -175,15 +178,13 @@ static void text_undosys_step_decode_redo(TextUndoStep *us) } } -static void text_undosys_step_decode(struct bContext *C, - struct Main *UNUSED(bmain), - UndoStep *us_p, - int dir) +static void text_undosys_step_decode( + struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p, int dir, bool is_final) { TextUndoStep *us = (TextUndoStep *)us_p; if (dir < 0) { - text_undosys_step_decode_undo(us); + text_undosys_step_decode_undo(us, is_final); } else { text_undosys_step_decode_redo(us); diff --git a/source/blender/editors/undo/memfile_undo.c b/source/blender/editors/undo/memfile_undo.c index 0f495d64b29..f3e2ee92558 100644 --- a/source/blender/editors/undo/memfile_undo.c +++ b/source/blender/editors/undo/memfile_undo.c @@ -83,10 +83,8 @@ static bool memfile_undosys_step_encode(struct bContext *UNUSED(C), return true; } -static void memfile_undosys_step_decode(struct bContext *C, - struct Main *bmain, - UndoStep *us_p, - int UNUSED(dir)) +static void memfile_undosys_step_decode( + struct bContext *C, struct Main *bmain, UndoStep *us_p, int UNUSED(dir), bool UNUSED(is_final)) { ED_editors_exit(bmain, false); |