summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Percival <graham@percival-music.ca>2010-12-14 15:31:33 +0000
committerGraham Percival <graham@percival-music.ca>2010-12-14 15:31:33 +0000
commit5d1bf24ececf8eb98890afcb2dbaef79e69f9d7b (patch)
tree9e6dc1e2db0b561ba3991854063d41b1b92fab01
parent93ff9b7a0c29d807832b67a584e83820b7472443 (diff)
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.
-rw-r--r--lily/page-breaking.cc14
-rw-r--r--lily/page-turn-page-breaking.cc3
2 files changed, 13 insertions, 4 deletions
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<vsize> 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<Break_node> *psoln)
SCM
Page_turn_page_breaking::make_pages (vector<Break_node> const &soln, SCM systems)
{
+ if (scm_is_null (systems))
+ return SCM_EOL;
+
vector<vsize> lines_per_page;
for (vsize i = 0; i < soln.size (); i++)
{