Insert time: don't unlock markers we're not going to move anyway
authorColin Fletcher <colin.m.fletcher@googlemail.com>
Sun, 14 Jun 2015 17:09:30 +0000 (18:09 +0100)
committerColin Fletcher <colin.m.fletcher@googlemail.com>
Wed, 17 Jun 2015 16:15:21 +0000 (17:15 +0100)
Move checking for locked markers in Editor::insert_time() so it doesn't
happen if we're going to skip the marker because it's glued to musical
time.

gtk2_ardour/editor_ops.cc

index c46b49505c10e853b74de653750d44bc5824d16e..c325ab59802f6dfd14ad90b2d6b55c0812bbdb3a 100644 (file)
@@ -7030,12 +7030,11 @@ Editor::insert_time (
 
                        Locations::LocationList::const_iterator tmp;
 
-                       bool const was_locked = (*i)->locked ();
-                       if (locked_markers_too) {
-                               (*i)->unlock ();
-                       }
-
                        if ((*i)->position_lock_style() == AudioTime || glued_markers_too) {
+                               bool const was_locked = (*i)->locked ();
+                               if (locked_markers_too) {
+                                       (*i)->unlock ();
+                               }
 
                                if ((*i)->start() >= pos) {
                                        // move end first, in case we're moving by more than the length of the range
@@ -7046,10 +7045,9 @@ Editor::insert_time (
                                        moved = true;
                                }
 
-                       }
-
-                       if (was_locked) {
-                               (*i)->lock ();
+                               if (was_locked) {
+                                       (*i)->lock ();
+                               }
                        }
                }