]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/gourlay-breaking.cc
patch texinfo.tex to leave single quotes in
[lilypond.git] / lily / gourlay-breaking.cc
index f9ff08b6af31337e61dca877fe825c9e5c4808ad..62f537507395e7b83451eadf2179c1f036d1e77f 100644 (file)
@@ -57,7 +57,7 @@ struct Break_node
 };
 
 void
-print_break_nodes (std::vector<Break_node> const &arr)
+print_break_nodes (vector<Break_node> const &arr)
 {
   for (vsize i = 0; i < arr.size (); i++)
     {
@@ -74,20 +74,20 @@ print_break_nodes (std::vector<Break_node> const &arr)
    TODO: should rewrite. See the function in scm/page-layout.scm for
    inspiration.
 */
-std::vector<Column_x_positions>
-Gourlay_breaking::do_solve () const
+vector<Column_x_positions>
+Gourlay_breaking::solve () 
 {
-  std::vector<Break_node> optimal_paths;
-  Link_array<Grob> all
+  vector<Break_node> optimal_paths;
+  vector<Grob*> all
     = pscore_->root_system ()->columns ();
 
-  std::vector<int> breaks = find_break_indices ();
+  vector<int> breaks = pscore_->find_break_indices ();
 
   Break_node first_node;
   optimal_paths.push_back (first_node);
 
-  bool ragged_right = to_boolean (pscore_->layout ()->c_variable ("raggedright"));
-  bool ragged_last = to_boolean (pscore_->layout ()->c_variable ("raggedlast"));
+  bool ragged_right = to_boolean (pscore_->layout ()->c_variable ("ragged-right"));
+  bool ragged_last = to_boolean (pscore_->layout ()->c_variable ("ragged-last"));
 
   Real worst_force = 0.0;
   for (vsize break_idx = 1; break_idx < breaks.size (); break_idx++)
@@ -104,8 +104,8 @@ Gourlay_breaking::do_solve () const
 
       for (vsize start_idx = break_idx; start_idx--;)
        {
-         Link_array<Grob> line = all.slice (breaks[start_idx],
-                                            breaks[break_idx] + 1);
+         vector<Grob*> line (all.begin () + breaks[start_idx],
+                                 all.begin () + breaks[break_idx] + 1);
 
          line[0] = dynamic_cast<Item *> (line[0])->find_prebroken_piece (RIGHT);
          line.back () = dynamic_cast<Item *> (line.back ())->find_prebroken_piece (LEFT);
@@ -176,17 +176,17 @@ Gourlay_breaking::do_solve () const
       optimal_paths.push_back (bnod);
 
       if (! (break_idx % HAPPY_DOTS))
-       progress_indication (std::string ("[") + to_string (break_idx) + "]");
+       progress_indication (string ("[") + to_string (break_idx) + "]");
     }
 
   /* do the last one */
   if (breaks.size () % HAPPY_DOTS)
-    progress_indication (std::string ("[") + to_string (breaks.size ()) + "]");
+    progress_indication (string ("[") + to_string (breaks.size ()) + "]");
 
   progress_indication ("\n");
 
-  std::vector<int> final_breaks;
-  std::vector<Column_x_positions> lines;
+  vector<int> final_breaks;
+  vector<Column_x_positions> lines;
 
   /* skip 0-th element, since it is a "dummy" elt*/
   for (vsize i = optimal_paths.size () - 1; i > 0;)