]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spacing-loose-columns.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / spacing-loose-columns.cc
index 90e573667765134d5dfc1e7ceb786c7cbf493db9..0570741117b0a4e36b2bb4f08113fccfc5329d65 100644 (file)
@@ -3,10 +3,9 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-
 #include "system.hh"
 #include "paper-column.hh"
 #include "column-x-positions.hh"
@@ -24,7 +23,7 @@ set_loose_columns (System *which, Column_x_positions const *posns)
 {
   int loose_col_count = posns->loose_cols_.size ();
   if (!loose_col_count)
-    return; 
+    return;
 
   Real default_padding = 1.0;
   for (int i = 0; i < loose_col_count; i++)
@@ -39,7 +38,7 @@ set_loose_columns (System *which, Column_x_positions const *posns)
       Item *left = 0;
       Item *right = 0;
 
-      Link_array<Item> clique;
+      vector<Item*> clique;
       while (1)
        {
          SCM between = loose->get_object ("between-cols");
@@ -58,10 +57,10 @@ set_loose_columns (System *which, Column_x_positions const *posns)
              if (!left->get_system ())
                left = left->find_prebroken_piece (RIGHT);
 
-             clique.push (left);
+             clique.push_back (left);
            }
-         
-         clique.push (loose);
+
+         clique.push_back (loose);
 
          divide_over++;
          loose = right = re->get_column ();
@@ -70,28 +69,26 @@ set_loose_columns (System *which, Column_x_positions const *posns)
       if (!right->get_system ())
        right = right->find_prebroken_piece (LEFT);
 
-      clique.push (right);
+      clique.push_back (right);
 
       Grob *common = right->common_refpoint (left, X_AXIS);
-      Item *finished_right_column = clique.top();
-      
-      for (int j = clique.size() - 2; j > 0; j--)
+      Item *finished_right_column = clique.back ();
+
+      for (vsize j = clique.size () - 2; j > 0; j--)
        {
          int count = 0;
          Real total_space = 0.0;
          Real total_fixed = 0.0;
 
          extract_grob_set (col, "spacing-wishes", wishes);
-         for (int i = 0; i < wishes.size (); i++)
+         for (vsize i = 0; i < wishes.size (); i++)
            {
              Grob *spacing = wishes[i];
              Real space = 0.0;
              Real fixed = 0.0;
 
              if (Staff_spacing::has_interface (spacing))
-               {
-                 Staff_spacing::get_spacing_params (spacing, &space, &fixed);
-               }
+               Staff_spacing::get_spacing_params (spacing, &space, &fixed);
              else if (Note_spacing::has_interface (spacing))
                {
                  Spacing_options options;
@@ -106,10 +103,8 @@ set_loose_columns (System *which, Column_x_positions const *posns)
                                             &space, &fixed);
                }
              else
-               {
-                 continue;
-               }
-         
+               continue;
+
              count++;
 
              total_space += space;
@@ -117,7 +112,7 @@ set_loose_columns (System *which, Column_x_positions const *posns)
            }
 
          Real distance_to_next = 0.0;
-         Real right_point = 0.0;  
+         Real right_point = 0.0;
          if (count)
            {
              total_space /= count;
@@ -135,7 +130,7 @@ set_loose_columns (System *which, Column_x_positions const *posns)
            }
 
          Real my_offset = right_point - distance_to_next;
-         
+
          col->system_ = which;
          col->translate_axis (my_offset - col->relative_coordinate (common, X_AXIS), X_AXIS);
 
@@ -144,4 +139,3 @@ set_loose_columns (System *which, Column_x_positions const *posns)
     }
 }
 
-