From: Graham Percival Date: Tue, 14 Dec 2010 15:31:33 +0000 (+0000) Subject: Fix bookpart identifier crash with page-marker (1440) X-Git-Tag: release/2.13.43-1~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5d1bf24ececf8eb98890afcb2dbaef79e69f9d7b;p=lilypond.git Fix bookpart identifier crash with page-marker (1440) Patch from Neil, with assistance from Carl. I'm committing this now so that I can get another release out. --- diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc index f3b1f84de3..bc9016ff6a 100644 --- a/lily/page-breaking.cc +++ b/lily/page-breaking.cc @@ -343,9 +343,8 @@ Page_breaking::systems () ->get_broken_system_grobs (); ret = scm_cons (lines, ret); } - else + else if (Prob *pb = system_specs_[sys].prob_) { - Prob *pb = system_specs_[sys].prob_; ret = scm_cons (scm_list_1 (pb->self_scm ()), ret); pb->unprotect (); } @@ -465,6 +464,9 @@ Page_breaking::draw_page (SCM systems, SCM configuration, int page_num, bool las SCM Page_breaking::make_pages (vector lines_per_page, SCM systems) { + if (scm_is_null (systems)) + return SCM_EOL; + int first_page_number = robust_scm2int (book_->paper_->c_variable ("first-page-number"), 1); SCM ret = SCM_EOL; @@ -554,6 +556,8 @@ Page_breaking::create_system_list () system_specs_.push_back (System_spec (pb)); } } + if (!system_specs_.size ()) + system_specs_.push_back (System_spec ()); } void @@ -630,7 +634,7 @@ Page_breaking::find_chunks_and_breaks (Break_predicate is_break, Prob_break_pred } line_breaking_.push_back (Constrained_breaking (system_specs_[i].pscore_, line_breaker_columns)); } - else + else if (system_specs_[i].prob_) { bool break_point = prob_is_break && prob_is_break (system_specs_[i].prob_); if (break_point || i == system_specs_.size () - 1) @@ -832,7 +836,9 @@ Page_breaking::cache_line_details (vsize configuration_index) else { assert (div[i] == 1); - uncompressed_line_details_.push_back (Line_details (system_specs_[sys].prob_, book_->paper_)); + uncompressed_line_details_.push_back (system_specs_[sys].prob_ + ? Line_details (system_specs_[sys].prob_, book_->paper_) + : Line_details ()); } } cached_line_details_ = compress_lines (uncompressed_line_details_); diff --git a/lily/page-turn-page-breaking.cc b/lily/page-turn-page-breaking.cc index 9338a38bfc..e57c0cbf2f 100644 --- a/lily/page-turn-page-breaking.cc +++ b/lily/page-turn-page-breaking.cc @@ -269,6 +269,9 @@ Page_turn_page_breaking::make_lines (vector *psoln) SCM Page_turn_page_breaking::make_pages (vector const &soln, SCM systems) { + if (scm_is_null (systems)) + return SCM_EOL; + vector lines_per_page; for (vsize i = 0; i < soln.size (); i++) {