]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/page-turn-page-breaking.cc
Fix #230.
[lilypond.git] / lily / page-turn-page-breaking.cc
index c6a1381f3670280cc8349a48f1c521b53da37970..36ffb5b806870fcb41fe1a462973435a35d42b4a 100644 (file)
@@ -217,7 +217,7 @@ Page_turn_page_breaking::solve ()
   state_.clear ();
   message (_f ("Calculating page and line breaks (%d possible page breaks)...",
                (int)breaks_.size () - 1) + " ");
-  for (vsize i = 0; i < breaks_.size () - 1; i++)
+  for (vsize i = 0; i + 1 < breaks_.size (); i++)
     {
       calc_subproblem (i);
       progress_indication (string ("[") + to_string (i + 1) + "]");
@@ -263,7 +263,7 @@ Page_turn_page_breaking::make_pages (vector<Break_node> const &soln, SCM systems
       for (vsize j = 0; j < soln[i].page_count_; j++)
        lines_per_page.push_back (soln[i].system_count_[j]);
 
-      if (i < soln.size () - 1 && (soln[i].first_page_number_ + soln[i].page_count_) % 2)
+      if (i + 1 < soln.size () && (soln[i].first_page_number_ + soln[i].page_count_) % 2)
        /* add a blank page */
        lines_per_page.push_back (0);
     }