]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/book.cc
Merge branch 'lilypond/translation' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / book.cc
index 96243e1b954647127c7dc50d4bd51ed1293618cb..303af1b8e3602e88f1338ef0e0c01a6e3c09d9e6 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "book.hh"
@@ -127,8 +127,8 @@ Book::set_parent (Book *parent)
       paper_->unprotect ();
     }
   paper_->parent_ = parent->paper_;
-  /* If this part is the first child of parent, copy its header */
-  if (ly_is_module (parent->header_) && (scm_is_null (parent->bookparts_)))
+  /* Copy the header block of the parent */
+  if (ly_is_module (parent->header_))
     {
       SCM tmp_header = ly_make_anonymous_module (false);
       ly_module_copy (tmp_header, parent->header_);
@@ -200,9 +200,14 @@ Book::process_bookparts (Paper_book *output_paper_book, Output_def *paper, Outpu
         {
           Paper_book *paper_book_part = book->process (paper, layout, output_paper_book);
           if (paper_book_part)
-            output_paper_book->add_bookpart (paper_book_part->self_scm ());
+           {
+             output_paper_book->add_bookpart (paper_book_part->self_scm ());
+             paper_book_part->unprotect ();
+           }
         }
     }
+  /* In a Paper_book, bookparts are stored in straight order */
+  output_paper_book->bookparts_ = scm_reverse_x (output_paper_book->bookparts_, SCM_EOL);
 }
 
 void
@@ -263,6 +268,7 @@ Book::process (Output_def *default_paper,
       paper_book->paper_->parent_ = parent_part->paper_;
     }
   paper_book->header_ = header_;
+  scaled_bookdef->unprotect ();
 
   if (scm_is_pair (bookparts_))
     {