]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lyric-combine-music-iterator.cc
Run `make grand-replace'.
[lilypond.git] / lily / lyric-combine-music-iterator.cc
index 7639e03a8f35dcbbfee034d3dae77f81ae08d768..26a4dfa5871a2d23cfaa3d6a21ad5e6c49bfd8d2 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2004--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2004--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "dispatcher.hh"
@@ -97,13 +97,15 @@ Lyric_combine_music_iterator::set_music_context (Context *to)
 {
   if (music_context_)
     {
-      music_context_->event_source ()->remove_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
+      music_context_->event_source ()->
+       remove_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
     }
 
   music_context_ = to;
   if (to)
     {
-      to->event_source ()->add_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
+      to->event_source ()->add_listener (GET_LISTENER (set_busy),
+                                        ly_symbol2scm ("music-event"));
     }
 }
 
@@ -209,6 +211,9 @@ IMPLEMENT_LISTENER (Lyric_combine_music_iterator, check_new_context)
 void
 Lyric_combine_music_iterator::check_new_context (SCM sev)
 {
+  if (!ok ())
+    return ;
+  
   // TODO: Check first if type=Voice and if id matches
   Stream_event * ev = unsmob_stream_event (sev);
   if (ev->get_property ("type") != ly_symbol2scm ("Voice"))