]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/music-wrapper-iterator.cc
patch::: 1.3.151.jcn1
[lilypond.git] / lily / music-wrapper-iterator.cc
index c052d14ff511dfc0d095dc375d58835c05653b8a..a80577f387ebae0cfcb65c780ed94923c3ecb2fd 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
  */
 
 
@@ -18,7 +18,10 @@ Music_wrapper_iterator::Music_wrapper_iterator ()
 Music_wrapper_iterator::Music_wrapper_iterator (Music_wrapper_iterator const &src)
   : Music_iterator (src)
 {
-  child_iter_p_ = src.child_iter_p_->clone ();
+  if (src.child_iter_p_)
+    child_iter_p_ = src.child_iter_p_->clone ();
+  else
+    child_iter_p_ = 0;
 }
 
 Music_wrapper_iterator::~Music_wrapper_iterator ()
@@ -39,10 +42,18 @@ Music_wrapper_iterator::ok () const
 {
   return child_iter_p_ && child_iter_p_->ok ();
 }
-
 void
 Music_wrapper_iterator::skip (Moment m)
 {
+  /*
+    FIXME: should make sure that the initial try_music () is skipped as
+    well, if you would do
+
+    iter = get_iterator (Side_effect_music); // eg. property setting
+    iter->skip (1/2)
+    iter->process ()
+
+  */
   child_iter_p_->skip (m);
 }
 
@@ -69,3 +80,5 @@ Music_wrapper_iterator::try_music_in_children (Music *m) const
 {
   return child_iter_p_->try_music (m);
 }
+
+IMPLEMENT_CTOR_CALLBACK (Music_wrapper_iterator);