Fix #7007: ::clear_owned_changes() on rippled Playlist before commit

RegionMoveDrag::finished_no_copy() calls ::clear_changes() on every selected
Region and then sets their positions again before committing the command to the
UndoHistory. By doing that no changes from the previous transaction spill over
into the current transaction.

This needs to be done in a similar way by in RegionRippleDrag::finished()
because otherwise a following undo action would also undo the changes of the
previous transaction for all the non selected rippled regions.

RegionRippleDrags across tracks are still borked, though.
This commit is contained in:
Johannes Mueller 2020-04-13 22:14:32 +02:00
parent 83353b3125
commit d5f25f998b

View file

@ -2414,7 +2414,6 @@ RegionRippleDrag::finished (GdkEvent* event, bool movement_occurred)
// remove the regions being rippled from the dragging view, updating them to
// their new positions
remove_unselected_from_views (prev_amount, true);
if (allow_moves_across_tracks) {
if (orig_tav) {
@ -2422,6 +2421,8 @@ RegionRippleDrag::finished (GdkEvent* event, bool movement_occurred)
// regions on the track the regions were dragged off, so we need
// to add the original track to the undo record
orig_tav->playlist()->clear_changes();
orig_tav->playlist()->clear_owned_changes();
remove_unselected_from_views (prev_amount, true);
vector<Command*> cmds;
orig_tav->playlist()->rdiff (cmds);
_editor->session()->add_commands (cmds);
@ -2440,6 +2441,11 @@ RegionRippleDrag::finished (GdkEvent* event, bool movement_occurred)
for (pi = playlists.begin(); pi != playlists.end(); ++pi) {
(*pi)->clear_changes();
(*pi)->clear_owned_changes();
}
remove_unselected_from_views (prev_amount, true);
for (pi = playlists.begin(); pi != playlists.end(); ++pi) {
vector<Command*> cmds;
(*pi)->rdiff (cmds);
_editor->session()->add_commands (cmds);