]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/page-breaking.cc
Move fix for beginning break into paper-column-engraver
[lilypond.git] / lily / page-breaking.cc
index b5c38293e5fdeacb180605b9ea8b20bebf04b623..abb2a3e2148436c3e9fb3a333c7e2800bcd37b0f 100644 (file)
@@ -75,7 +75,12 @@ void
 Page_breaking::break_into_pieces (vsize start_break, vsize end_break, Line_division const &div)
 {
   vector<Break_position> chunks = chunk_list (start_break, end_break);
-  assert (chunks.size () == div.size () + 1);
+  bool ignore_div = false;
+  if (chunks.size () != div.size () + 1)
+    {
+      programming_error ("did not find a valid page breaking configuration");
+      ignore_div = true;
+    }
 
   for (vsize i = 0; i + 1 < chunks.size (); i++)
     {
@@ -86,7 +91,9 @@ Page_breaking::break_into_pieces (vsize start_break, vsize end_break, Line_divis
          vsize end;
          line_breaker_args (sys, chunks[i], chunks[i+1], &start, &end);
 
-         vector<Column_x_positions> pos = line_breaking_[sys].solve (start, end, div[i]);
+         vector<Column_x_positions> pos = ignore_div
+           ? line_breaking_[sys].best_solution (start, end)
+           : line_breaking_[sys].solve (start, end, div[i]);
          all_[sys].pscore_->root_system ()->break_into_pieces (pos);
        }
     }