]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/accidental-placement.cc
bump version
[lilypond.git] / lily / accidental-placement.cc
index 6aaf49b2e6ea12c11ab32370de72453f9a9f85ed..8e75206dc81bafeb5da5451d625ac70b4d1ca8aa 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2002--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2002--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 
@@ -243,7 +243,7 @@ stagger_apes (vector<Accidental_placement_entry*> *apes)
 
 */
 
-MAKE_SCHEME_CALLBACK(Accidental_placement, calc_positioning_done, 1);
+MAKE_SCHEME_CALLBACK (Accidental_placement, calc_positioning_done, 1);
 SCM
 Accidental_placement::calc_positioning_done (SCM smob)
 {
@@ -251,6 +251,8 @@ Accidental_placement::calc_positioning_done (SCM smob)
   if (!me->is_live ())
     return SCM_BOOL_T;
 
+  me->set_property ("positioning-done", SCM_BOOL_T);
+  
   SCM accs = me->get_object ("accidental-grobs");
   if (!scm_is_pair (accs))
     return SCM_BOOL_T;
@@ -397,8 +399,8 @@ Accidental_placement::calc_positioning_done (SCM smob)
   Real padding = robust_scm2double (me->get_property ("padding"), 0.2);
 
   Skyline left_skyline = head_ape->left_skyline_;
-  left_skyline.raise (-robust_scm2double (me->get_property ("right-padding"), 0))
-;
+  left_skyline.raise (-robust_scm2double (me->get_property ("right-padding"), 0));
+  
   /*
     Add accs entries right-to-left.
   */
@@ -406,7 +408,7 @@ Accidental_placement::calc_positioning_done (SCM smob)
     {
       Real offset = -apes[i]->right_skyline_.distance (left_skyline);
       if (isinf (offset))
-       offset = (i < apes.size () - 1) ? apes[i + 1]->offset_ : 0.0;
+       offset = (i + 1 < apes.size ()) ? apes[i + 1]->offset_ : 0.0;
       else
        offset -= padding;
 
@@ -442,9 +444,10 @@ Accidental_placement::calc_positioning_done (SCM smob)
   me->flush_extent_cache (X_AXIS);
   me->set_property ("X-extent", scm_width);
 
-  for (vsize i = apes.size (); i--;)
-    delete apes[i];
+  junk_pointers (apes);
 
+  delete head_ape;
+  
   return SCM_BOOL_T;
 }