]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix crash on page breaking
authorJoe Neeman <joeneeman@gmail.com>
Wed, 4 Jul 2007 01:47:40 +0000 (11:47 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Wed, 4 Jul 2007 01:47:40 +0000 (11:47 +1000)
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..357eaabb780f191568a26c24c7d93db56d62f0c6 100644 (file)
@@ -759,6 +759,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_);