diff options
Diffstat (limited to 'gtk2_ardour/editor_selection.cc')
-rw-r--r-- | gtk2_ardour/editor_selection.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 3052fb72fa..417d28f8da 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -776,7 +776,7 @@ Editor::select_all_within (nframes_t start, nframes_t end, double top, double bo list<Selectable*>::size_type n = 0; TrackViewList touched_tracks; - for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) { + for (TrackViewList::iterator iter = selection->tracks.begin(); iter != selection->tracks.end(); ++iter) { if ((*iter)->hidden()) { continue; } @@ -784,13 +784,18 @@ Editor::select_all_within (nframes_t start, nframes_t end, double top, double bo n = touched.size(); (*iter)->get_selectables (start, end, top, bot, touched); - + if (n != touched.size()) { touched_tracks.push_back (*iter); } } + if (touched.empty()) { + return false; + } + if (!touched_tracks.empty()) { + switch (op) { case Selection::Add: selection->add (touched_tracks); @@ -806,7 +811,7 @@ Editor::select_all_within (nframes_t start, nframes_t end, double top, double bo break; } } - + begin_reversible_command (_("select all within")); switch (op) { case Selection::Add: @@ -822,8 +827,9 @@ Editor::select_all_within (nframes_t start, nframes_t end, double top, double bo /* not defined yet */ break; } - + commit_reversible_command (); + return !touched.empty(); } |