From 8560c029f084cc3ff26e08077e62bb7e49f26b81 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 19 Apr 2011 10:18:04 +0000 Subject: [PATCH] Sort track selections before cut/copying their playlists, so that the list of selected playlists is in the same order as their parent tracks are in the editor. Fixes range copy/paste onto several tracks (#3984). git-svn-id: svn://localhost/ardour2/branches/3.0@9370 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_ops.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 252c03a8ac..935694a640 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -3831,6 +3831,13 @@ Editor::cut_copy_ranges (CutCopyOp op) TrackViewList* ts; TrackViewList entered; + /* Sort the track selection now, so that it if is used, the playlists + selected by the calls below to cut_copy_clear are in the order that + their tracks appear in the editor. This makes things like paste + of ranges work properly. + */ + sort_track_selection (&selection->tracks); + if (selection->tracks.empty()) { if (!entered_track) { return; @@ -3899,7 +3906,7 @@ Editor::paste_internal (framepos_t position, float times) ts = selection->tracks; } else if (_last_cut_copy_source_track) { /* otherwise paste to the track that the cut/copy came from; - see discussion in mants #3333. + see discussion in mantis #3333. */ ts.push_back (_last_cut_copy_source_track); }