Patch from Lincoln to fix uncommitted reversible command during rubberband selection...
authorCarl Hetherington <carl@carlh.net>
Sun, 23 Jan 2011 23:13:46 +0000 (23:13 +0000)
committerCarl Hetherington <carl@carlh.net>
Sun, 23 Jan 2011 23:13:46 +0000 (23:13 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8563 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor.h
gtk2_ardour/editor_drag.cc
gtk2_ardour/editor_selection.cc

index 4ca814ce640c0c087ce17884204d8295ebb1cac6..b14c5f20e700b7ec5be5870eee8a6b15ddedaba1 100644 (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;
 
index 24182397c349dd9f5b44192023c80736bf2fcd37..caaccb1fca3cfb3b81384a56cd383ac46769f140 100644 (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();
index 0a7ad1958c642671c61b41614fb14fd4729f0e7c..482a778ae721fcc61bb326853282bdace81efaf0 100644 (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