]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tie-engraver.cc
(stop_translation_timestep): robustness for ambiti.
[lilypond.git] / lily / tie-engraver.cc
index 9547d14025ae9e81c08f5f6cf8dc3444168ea594..11f534cdec8af2d792dbb205b55127420a979a19 100644 (file)
@@ -94,13 +94,13 @@ Tie_engraver::listen_tie (Stream_event *ev)
 void
 Tie_engraver::process_music ()
 {
-  bool busy = event_;
-  for (vsize i = 0; !busy && i < heads_to_tie_.size (); i++)
-    busy |=  (heads_to_tie_[i].tie_event_
-             || heads_to_tie_[i].tie_stream_event_);
-
-  if (busy)
-    context ()->set_property ("tieMelismaBusy", SCM_BOOL_T);
+  for (vsize i = 0; i < heads_to_tie_.size (); i++)
+    if (heads_to_tie_[i].tie_event_
+       || heads_to_tie_[i].tie_stream_event_)
+      {
+       context ()->set_property ("tieMelismaBusy", SCM_BOOL_T);
+       break;
+      }
 }
 
 void
@@ -181,7 +181,8 @@ Tie_engraver::stop_translation_timestep ()
       tie_column_ = 0;
     }
 
-  vector<Head_event_tuple> new_heads_to_tie;
+  if (!wait)
+    heads_to_tie_.clear ();
   
   for (vsize i = 0; i < now_heads_.size (); i++)
     {
@@ -235,17 +236,10 @@ Tie_engraver::stop_translation_timestep ()
            }
          event_tup.end_moment_ = end;
            
-         new_heads_to_tie.push_back (event_tup);
+         heads_to_tie_.push_back (event_tup);
        }
     }
 
-  if (!wait && new_heads_to_tie.size ())
-    heads_to_tie_.clear ();
-
-  // hmmm, how to do with copy() ?
-  for (vsize i = 0; i < new_heads_to_tie.size (); i++)
-    heads_to_tie_.push_back (new_heads_to_tie[i]);
-  
   event_ = 0;
   now_heads_.clear ();
 }