]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of ssh+git://gpercival@git.sv.gnu.org/srv/git/lilypond
authorGraham Percival <graham@percival-music.ca>
Wed, 4 Jul 2007 04:49:22 +0000 (21:49 -0700)
committerGraham Percival <graham@percival-music.ca>
Wed, 4 Jul 2007 04:49:22 +0000 (21:49 -0700)
lily/optimal-page-breaking.cc
lily/page-breaking.cc

index 728e726a5e3e476e540018d7a9041a0b1bbb964b..34ff7f1b184cb519b418c2b44f53417599a31b4d 100644 (file)
@@ -52,7 +52,7 @@ Optimal_page_breaking::solve ()
   vsize ideal_sys_count = best.system_count ();
   vsize min_sys_count = ideal_sys_count - best.systems_per_page_.back ();
   
-  if (page_count > 1)
+  if (page_count > 1 && best.systems_per_page_[page_count - 2] > 1)
     min_sys_count -= best.systems_per_page_[page_count - 2];
 
   if (page_count == 1)
index 2c137e36842f108b22da3b7583a4a0f67bf38611..709ee52cb3eb433a9d9ead01143f12e49a07d9f2 100644 (file)
@@ -726,7 +726,9 @@ Page_breaking::space_systems_on_n_or_one_more_pages (vsize configuration, vsize
 
   Real penalty = blank_page_penalty ();
   n_res.demerits_ += penalty;
-  n_res.force_.back () += penalty;
+
+  if (n_res.force_.size ())
+    n_res.force_.back () += penalty;
 
   return (m_res.demerits_ < n_res.demerits_) ? m_res : n_res;
 }
@@ -759,6 +761,9 @@ Page_breaking::space_systems_on_best_pages (vsize configuration, vsize first_pag
 Page_spacing_result
 Page_breaking::finalize_spacing_result (vsize configuration, Page_spacing_result res)
 {
+  if (res.force_.empty ())
+    return res;
+
   cache_line_details (configuration);
   res.systems_per_page_ = uncompress_solution (res.systems_per_page_, cached_line_details_);