]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spacing-determine-loose-columns.cc
Doc-es: fix repeated word.
[lilypond.git] / lily / spacing-determine-loose-columns.cc
index 79551ecac37d5d06aaed4ea40175c413179a1ae2..785f01039caed06049c4bede4fc60f36555bbc80 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2005--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -134,10 +134,9 @@ Spacing_spanner::set_distances_for_loose_col (Grob *me, Grob *c,
                                               Drul_array<Item *> next_door,
                                               Spacing_options const *options)
 {
-  Direction d = LEFT;
   Drul_array<Real> dists (0, 0);
 
-  do
+  for (LEFT_and_RIGHT (d))
     {
       Item *lc = dynamic_cast<Item *> ((d == LEFT) ? next_door[LEFT] : c);
       Item *rc = dynamic_cast<Item *> (d == LEFT ? c : next_door[RIGHT]);
@@ -163,7 +162,7 @@ Spacing_spanner::set_distances_for_loose_col (Grob *me, Grob *c,
             }
           else if (Staff_spacing::has_interface (sp))
             {
-              Spring spring = Staff_spacing::get_spacing (sp, rc);
+              Spring spring = Staff_spacing::get_spacing (sp, rc, 0.0);
 
               dists[d] = max (dists[d], spring.min_distance ());
             }
@@ -171,7 +170,6 @@ Spacing_spanner::set_distances_for_loose_col (Grob *me, Grob *c,
             programming_error ("Subversive spacing wish");
         }
     }
-  while (flip (&d) != LEFT);
 
   Rod r;
   r.distance_ = dists[LEFT] + dists[RIGHT];
@@ -191,7 +189,6 @@ Spacing_spanner::prune_loose_columns (Grob *me,
                                       Spacing_options *options)
 {
   vector<Grob *> newcols;
-
   for (vsize i = 0; i < cols->size (); i++)
     {
       Grob *c = cols->at (i);
@@ -243,14 +240,14 @@ Spacing_spanner::prune_loose_columns (Grob *me,
               /*
                 Set distance constraints for loose columns
               */
-              Drul_array<Item *> next_door (dynamic_cast<Item *> (cols->at (i - 1)),
-                                            dynamic_cast<Item *> (cols->at (i + 1)));
+              Drul_array<Item *> next_door (dynamic_cast<Item *> (left_neighbor),
+                                            dynamic_cast<Item *> (right_neighbor));
 
               set_distances_for_loose_col (me, c, next_door, options);
             }
         }
 
-      if (!loose)
+      else
         newcols.push_back (c);
     }