]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-spacing-engraver.cc
Run `make grand-replace'.
[lilypond.git] / lily / note-spacing-engraver.cc
index 3131f17777abea5867aaf294cfe56671c57a79c6..8a5f5c7944228753efbc518241bf09773827fac6 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 2006--2007 Han-Wen Nienhuys <hanwen@lilypond.org>
+  (c) 2006--2008 Han-Wen Nienhuys <hanwen@lilypond.org>
   
 */
 
@@ -22,6 +22,7 @@ class Note_spacing_engraver : public Engraver
 {
   typedef map <Context*, Grob*> Last_spacing_map;
   Last_spacing_map last_spacings_;
+  Grob *last_spacing_;
   
   Grob *spacing_;
 
@@ -47,6 +48,7 @@ Note_spacing_engraver::derived_mark () const
 Note_spacing_engraver::Note_spacing_engraver ()
 {
   spacing_ = 0;
+  last_spacing_ = 0;
 }
 
 void
@@ -63,9 +65,8 @@ Note_spacing_engraver::add_spacing_item (Grob *g)
                                         ly_symbol2scm ("left-items"),
                                         g);
 
-      Grob *last_spacing = last_spacings_[context ()->get_parent_context ()];
-      if (last_spacing)
-       Pointer_group_interface::add_grob (last_spacing,
+      if (last_spacing_)
+       Pointer_group_interface::add_grob (last_spacing_,
                                           ly_symbol2scm ("right-items"),
                                           g);
     }
@@ -119,6 +120,7 @@ Note_spacing_engraver::stop_translation_timestep ()
   if (spacing_)
     {
       last_spacings_[parent] = spacing_;
+      last_spacing_ = spacing_;
       spacing_ = 0;
     }
 
@@ -128,7 +130,16 @@ ADD_ACKNOWLEDGER (Note_spacing_engraver, note_column);
 ADD_ACKNOWLEDGER (Note_spacing_engraver, rhythmic_grob);
 
 ADD_TRANSLATOR (Note_spacing_engraver,
-               /* doc */ "Generates NoteSpacing, an object linking horizontal lines for use in spacing.",
-               /* create */ "NoteSpacing",
-               /* read */ "",
-               /* write */ "");
+               /* doc */
+               "Generate @code{NoteSpacing}, an object linking horizontal"
+               " lines for use in spacing.",
+
+               /* create */
+               "NoteSpacing ",
+
+               /* read */
+               "",
+
+               /* write */
+               ""
+               );