From: Joe Neeman Date: Tue, 3 Jul 2007 23:02:17 +0000 (+1000) Subject: more robustness if we are asked for a bad number of pages X-Git-Tag: release/2.11.28-1~33^2~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3ae355d357e6c4e5bd0e6f721d3201881b325116;p=lilypond.git more robustness if we are asked for a bad number of pages --- diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc index 2c137e3684..c4a2cf4881 100644 --- a/lily/page-breaking.cc +++ b/lily/page-breaking.cc @@ -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_);