]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spacing-determine-loose-columns.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / spacing-determine-loose-columns.cc
index 8b54857b1dedceb7b254277d787e388b83b2bffe..34f4c97214c50bab299e42aa6f13717abef1d32d 100644 (file)
@@ -37,7 +37,7 @@ is_loose_column (Grob *l, Grob *c, Grob *r, Spacing_options const *options)
     return true;
 
   if (Paper_column::is_musical (c)
-      || Item::is_breakable (c))
+      || Paper_column::is_breakable (c))
     return false;
 
   extract_grob_set (c, "right-neighbors", rns);
@@ -87,8 +87,8 @@ is_loose_column (Grob *l, Grob *c, Grob *r, Spacing_options const *options)
     some cases (two isolated, consecutive clef changes) won't be
     nicely folded, but hey, then don't do that.
   */
-  if (! ((Paper_column::is_musical (l_neighbor) || Item::is_breakable (l_neighbor))
-        && (Paper_column::is_musical (r_neighbor) || Item::is_breakable (r_neighbor))))
+  if (! ((Paper_column::is_musical (l_neighbor) || Paper_column::is_breakable (l_neighbor))
+        && (Paper_column::is_musical (r_neighbor) || Paper_column::is_breakable (r_neighbor))))
     return false;
 
   /*
@@ -126,17 +126,17 @@ is_loose_column (Grob *l, Grob *c, Grob *r, Spacing_options const *options)
   between.
 */
 void
-Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols,
+Spacing_spanner::prune_loose_columns (Grob *me, vector<Grob*> *cols,
                                      Spacing_options const *options)
 {
-  Link_array<Grob> newcols;
+  vector<Grob*> newcols;
 
   for (vsize i = 0; i < cols->size (); i++)
     {
-      Grob *c = cols->elem (i);
+      Grob *c = cols->at (i);
 
       bool loose = (i > 0 && i < cols->size () - 1)
-       && is_loose_column (cols->elem (i - 1), c, cols->elem (i + 1), options);
+       && is_loose_column (cols->at (i - 1), c, cols->at (i + 1), options);
 
       if (loose)
        {
@@ -159,8 +159,8 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols,
            Set distance constraints for loose columns
          */
          Drul_array<Grob *> next_door;
-         next_door[LEFT] = cols->elem (i - 1);
-         next_door[RIGHT] = cols->elem (i + 1);
+         next_door[LEFT] = cols->at (i - 1);
+         next_door[RIGHT] = cols->at (i + 1);
          Direction d = LEFT;
          Drul_array<Real> dists (0, 0);
 
@@ -212,8 +212,8 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols,
 
          Rod r;
          r.distance_ = dists[LEFT] + dists[RIGHT];
-         r.item_drul_[LEFT] = dynamic_cast<Item *> (cols->elem (i - 1));
-         r.item_drul_[RIGHT] = dynamic_cast<Item *> (cols->elem (i + 1));
+         r.item_drul_[LEFT] = dynamic_cast<Item *> (cols->at (i - 1));
+         r.item_drul_[RIGHT] = dynamic_cast<Item *> (cols->at (i + 1));
 
          r.add_to_cols ();
        }
@@ -228,7 +228,7 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols,
   Set neighboring columns determined by the spacing-wishes grob property.
 */
 void
-Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> const &cols)
+Spacing_spanner::set_explicit_neighbor_columns (vector<Grob*> const &cols)
 {
   for (vsize i = 0; i < cols.size (); i++)
     {
@@ -300,12 +300,12 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> const &cols)
   yet. Only do breakable non-musical columns, and musical columns.
 */
 void
-Spacing_spanner::set_implicit_neighbor_columns (Link_array<Grob> const &cols)
+Spacing_spanner::set_implicit_neighbor_columns (vector<Grob*> const &cols)
 {
   for (vsize i = 0; i < cols.size (); i++)
     {
       Item *it = dynamic_cast<Item *> (cols[i]);
-      if (!Item::is_breakable (it) && !Paper_column::is_musical (it))
+      if (!Paper_column::is_breakable (it) && !Paper_column::is_musical (it))
        continue;
 
       // it->breakable || it->musical