]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/separating-line-group-engraver.cc
2003 -> 2004
[lilypond.git] / lily / separating-line-group-engraver.cc
index 2cb1cf9aa2442569345d232a7b7fa75167e6d7c4..6bcd774ed87455cd057543db2b7660878e1d6834 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
@@ -53,7 +53,7 @@ protected:
   Spanner * sep_span_;
   
   virtual void acknowledge_grob (Grob_info);
-  virtual void initialize ();
+  virtual void process_music ();
   virtual void finalize ();
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();  
@@ -69,17 +69,23 @@ Separating_line_group_engraver::Separating_line_group_engraver ()
 }
 
 void
-Separating_line_group_engraver::initialize ()
+Separating_line_group_engraver::process_music ()
 {
-  sep_span_ = new Spanner (get_property ("SeparatingGroupSpanner"));
 
-  announce_grob(sep_span_, SCM_EOL);
-  sep_span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
-}
+  if (!sep_span_)
+    {
+      sep_span_ = make_spanner ("SeparatingGroupSpanner");
 
+      announce_grob(sep_span_, SCM_EOL);
+      sep_span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
+    }
+}
 void
 Separating_line_group_engraver::finalize ()
 {
+  if (!sep_span_)
+    return ;
+  
   SCM ccol = get_property ("currentCommandColumn");
   Grob *column = unsmob_grob (ccol);
   
@@ -128,7 +134,7 @@ Separating_line_group_engraver::acknowledge_grob (Grob_info i)
 
   if (!p_ref_)
     {
-      p_ref_ = new Item (get_property ("SeparationItem"));
+      p_ref_ = make_item ("SeparationItem");
 
       if (ib)
        {
@@ -139,7 +145,7 @@ Separating_line_group_engraver::acknowledge_grob (Grob_info i)
 
       if (p_ref_ == break_item_)
        {
-         Item *it  = new Item (get_property ("StaffSpacing"));
+         Item *it  = make_item ("StaffSpacing");
          current_spacings_.staff_spacing_ = it;
          it->set_grob_property ("left-items", gh_cons (break_item_->self_scm (), SCM_EOL));