From: Nicolas Sceaux Date: Sat, 23 Aug 2008 18:51:03 +0000 (+0200) Subject: Book parts: ragged-bottom-last and book titles X-Git-Tag: release/2.11.65-1~51^2~2^2~21 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1a202d714289de5cbab27fa18477e9e1968733d6;p=lilypond.git Book parts: ragged-bottom-last and book titles When a book part has a \header block capable of generating a book title, print the title, even if the part is not the first one. Ragged-bottomize the last page of a book part when ragged-bottom-last is true, even if the part is not the last one. --- diff --git a/lily/book.cc b/lily/book.cc index 700405f314..aa00be1a02 100644 --- a/lily/book.cc +++ b/lily/book.cc @@ -128,8 +128,10 @@ Book::set_parent (Book *parent) } paper_->parent_ = parent->paper_; - if (header_ == SCM_EOL) + if ((header_ == SCM_EOL) && (scm_is_null (parent->bookparts_))) { + /* If this is the first part, and it has no header, copy the + * parent header */ header_ = ly_make_anonymous_module (false); if (ly_is_module (parent->header_)) ly_module_copy (header_, parent->header_); diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc index a0aeddd43d..1bc13ffc5f 100644 --- a/lily/page-breaking.cc +++ b/lily/page-breaking.cc @@ -263,14 +263,14 @@ Page_breaking::make_pages (vector lines_per_page, SCM systems) for (vsize i = 0; i < lines_per_page.size (); i++) { SCM page_num = scm_from_int (i + first_page_number); - SCM last = scm_from_bool (last_part && (i == lines_per_page.size () - 1)); - SCM rag = scm_from_bool (ragged () || (to_boolean (last) - && ragged_last ())); + bool last_from_part = (i == lines_per_page.size () - 1); + SCM last_from_book = scm_from_bool (last_part && last_from_part); + SCM rag = scm_from_bool (ragged () || (last_from_part && ragged_last ())); SCM line_count = scm_from_int (lines_per_page[i]); SCM lines = scm_list_head (systems, line_count); SCM page = scm_apply_0 (make_page, scm_list_n (book, lines, page_num, - rag, last, SCM_UNDEFINED)); + rag, last_from_book, SCM_UNDEFINED)); /* collect labels */ for (SCM l = lines ; scm_is_pair (l) ; l = scm_cdr (l)) diff --git a/lily/paper-book.cc b/lily/paper-book.cc index 43e2012043..dfd3f6257f 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -381,18 +381,15 @@ Paper_book::get_system_specs () { SCM system_specs = SCM_EOL; - if (ly_scm2bool (paper_->c_variable ("part-is-first"))) + Stencil title = book_title (); + if (!title.is_empty ()) { - Stencil title = book_title (); - if (!title.is_empty ()) - { - SCM props = paper_->lookup_variable (ly_symbol2scm ("book-title-properties")); - Prob *ps = make_paper_system (props); - paper_system_set_stencil (ps, title); - - system_specs = scm_cons (ps->self_scm (), system_specs); - ps->unprotect (); - } + SCM props = paper_->lookup_variable (ly_symbol2scm ("book-title-properties")); + Prob *ps = make_paper_system (props); + paper_system_set_stencil (ps, title); + + system_specs = scm_cons (ps->self_scm (), system_specs); + ps->unprotect (); } SCM page_properties