]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/paper-score.cc
* The grand 2005-2006 replace.
[lilypond.git] / lily / paper-score.cc
index c6ff9edcfbd3903c002ac7d86fbbb2c4dbaf55e1..c34e80c50287afcd3071e159823f8d5256ef5db6 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1996--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "paper-score.hh"
@@ -26,6 +26,7 @@ Paper_score::Paper_score (Output_def *layout)
   layout_ = layout;
   system_ = 0;
   systems_ = SCM_EOL;
+  paper_systems_ = SCM_EOL;
 }
 
 Paper_score::Paper_score (Paper_score const &s)
@@ -34,11 +35,13 @@ Paper_score::Paper_score (Paper_score const &s)
   assert (false);
 }
 
-
 void
 Paper_score::derived_mark () const
 {
+  if (layout_)
+    scm_gc_mark (layout_->self_scm ());
   scm_gc_mark (systems_);
+  scm_gc_mark (paper_systems_);
 }
 
 void
@@ -49,8 +52,8 @@ Paper_score::typeset_system (System *system)
 
   systems_ = scm_cons (system->self_scm (), systems_);
   system->pscore_ = this;
-
-  scm_gc_unprotect_object (system->self_scm ());
+  system->layout_ = layout_;
+  system->unprotect ();
 }
 
 Array<Column_x_positions>
@@ -72,8 +75,8 @@ Paper_score::process ()
 {
   if (be_verbose_global)
     message (_f ("Element count %d (spanners %d) ",
-                            system_->element_count (),
-                            system_->spanner_count ()));
+                system_->element_count (),
+                system_->spanner_count ()));
 
   message (_ ("Preprocessing graphical objects...") + " ");
 
@@ -89,7 +92,8 @@ Paper_score::process ()
 
   Array<Column_x_positions> breaking = calc_breaking ();
   system_->break_into_pieces (breaking);
-  system_->get_paper_systems ();
+
+  paper_systems_ = system_->get_paper_systems ();
 }
 
 System *
@@ -103,10 +107,9 @@ Paper_score::layout () const
 {
   return layout_;
 }
-  
 
 SCM
-Paper_score::get_systems () const
+Paper_score::get_paper_systems () const
 {
-  return root_system ()->get_paper_systems ();
+  return paper_systems_;
 }