Patch from Lincoln to fix uncommitted reversible command during rubberband selection (#3729).

git-svn-id: svn://localhost/ardour2/branches/3.0@8563 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-01-23 23:13:46 +00:00
parent d48489ec1b
commit 7af9c8ae78
3 changed files with 7 additions and 12 deletions

View File

@ -1658,7 +1658,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
/* object rubberband select process */
bool select_all_within (framepos_t, framepos_t, double, double, TrackViewList const &, Selection::Operation, bool);
void select_all_within (framepos_t, framepos_t, double, double, TrackViewList const &, Selection::Operation, bool);
ArdourCanvas::SimpleRect *rubberband_rect;

View File

@ -3044,15 +3044,12 @@ RubberbandSelectDrag::finished (GdkEvent* event, bool movement_occurred)
_editor->begin_reversible_command (_("rubberband selection"));
if (grab_frame() < last_pointer_frame()) {
committed = _editor->select_all_within (grab_frame(), last_pointer_frame() - 1, y1, y2, _editor->track_views, op, false);
_editor->select_all_within (grab_frame(), last_pointer_frame() - 1, y1, y2, _editor->track_views, op, false);
} else {
committed = _editor->select_all_within (last_pointer_frame(), grab_frame() - 1, y1, y2, _editor->track_views, op, false);
}
if (!committed) {
_editor->commit_reversible_command ();
_editor->select_all_within (last_pointer_frame(), grab_frame() - 1, y1, y2, _editor->track_views, op, false);
}
_editor->commit_reversible_command ();
} else {
if (!getenv("ARDOUR_SAE")) {
_editor->selection->clear_tracks();

View File

@ -1275,7 +1275,7 @@ Editor::invert_selection ()
* @param preserve_if_selected true to leave the current selection alone if we're adding to the selection and all of the selectables
* within the region are already selected.
*/
bool
void
Editor::select_all_within (
framepos_t start, framepos_t end, double top, double bot, const TrackViewList& tracklist, Selection::Operation op, bool preserve_if_selected
)
@ -1292,7 +1292,7 @@ Editor::select_all_within (
}
if (found.empty()) {
return false;
return;
}
if (preserve_if_selected && op != Selection::Toggle) {
@ -1302,7 +1302,7 @@ Editor::select_all_within (
}
if (i == found.end()) {
return false;
return;
}
}
@ -1323,8 +1323,6 @@ Editor::select_all_within (
}
commit_reversible_command ();
return !found.empty();
}
void