[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Prevents lilypond from segfaulting with add-footer = ##f (issue4832046)
From: |
mtsolo |
Subject: |
Prevents lilypond from segfaulting with add-footer = ##f (issue4832046) |
Date: |
Mon, 01 Aug 2011 22:22:01 +0000 |
Reviewers: ,
Message:
Fixes Issue 1796.
Cheers,
MS
Description:
Prevents lilypond from segfaulting with add-footer = ##f
Please review this at http://codereview.appspot.com/4832046/
Affected files:
M lily/page-breaking.cc
M lily/page-layout-problem.cc
Index: lily/page-breaking.cc
diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc
index
2e5854885e02eb432458442628696f329fb844e2..f81683a2573277f2de404409219cba8d31aef005
100644
--- a/lily/page-breaking.cc
+++ b/lily/page-breaking.cc
@@ -577,7 +577,8 @@ Page_breaking::draw_page (SCM systems, SCM
configuration, int page_num, int foot
Page_layout_problem::add_footnotes_to_footer (footnotes, foot, book_);
- p->set_property ("foot-stencil", foot->smobbed_copy ());
+ if (foot)
+ p->set_property ("foot-stencil", foot->smobbed_copy ());
scm_apply_1 (page_stencil, page, SCM_EOL);
return page;
Index: lily/page-layout-problem.cc
diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc
index
c9301ff3843f6812c1c39a129df9511c01817aca..57f5b61fba6edfd18d99623c31cb148578c7fe80
100644
--- a/lily/page-layout-problem.cc
+++ b/lily/page-layout-problem.cc
@@ -277,6 +277,11 @@ Page_layout_problem::get_footnote_separator_stencil
(Output_def *paper)
void
Page_layout_problem::add_footnotes_to_footer (SCM footnotes, Stencil
*foot, Paper_book *pb)
{
+ if (!foot)
+ {
+ warning ("Must have a footer to add footnotes.");
+ return;
+ }
bool footnotes_found = false;
Real footnote_padding = robust_scm2double (pb->paper_->c_variable
("footnote-padding"), 0.0);
Real footnote_footer_padding = robust_scm2double (pb->paper_->c_variable
("footnote-footer-padding"), 0.0);
- Prevents lilypond from segfaulting with add-footer = ##f (issue4832046),
mtsolo <=