]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/system.cc (get_paper_system):
authorJoe Neeman <joeneeman@gmail.com>
Thu, 26 Oct 2006 07:49:48 +0000 (07:49 +0000)
committerJoe Neeman <joeneeman@gmail.com>
Thu, 26 Oct 2006 07:49:48 +0000 (07:49 +0000)
* lily/paper-book.cc (systems):
move most of the backwards compatibility stuff into
Paper_book::systems

ChangeLog
lily/paper-book.cc
lily/system.cc

index 511fdb4857bdeb67e973efd0755bf54a4420dbe9..61b5e01db8908c6ef52278e910aa6215411bdad8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-10-26  Joe Neeman  <joeneeman@gmail.com>
 
+       * lily/system.cc (get_paper_system): 
+       * lily/paper-book.cc (systems): 
+       move most of the backwards compatibility stuff into
+       Paper_book::systems
+
        * Documentation/topdocs/NEWS.tely: add 2 entries for the
        page breaking stuff
 
index d41feabbf42b29de174d3918444b29d2d10a76a6..37a156238a4e898dade1fc801dae3667b3a71a70 100644 (file)
@@ -11,6 +11,7 @@
 #include "grob.hh"
 #include "main.hh"
 #include "output-def.hh"
+#include "paper-column.hh"
 #include "paper-score.hh"
 #include "paper-system.hh"
 #include "text-interface.hh"
@@ -236,14 +237,14 @@ set_system_penalty (SCM sys, SCM header)
            {
              vector<Grob*> cols = ps->get_columns ();
              if (cols.size ())
-               cols.back ()->set_property ("page-break-permission", sym);
+               {
+                 Paper_column *col = dynamic_cast<Paper_column*> (cols.back ());
+                 col->set_property ("page-break-permission", sym);
+                 col->find_prebroken_piece (LEFT)->set_property ("page-break-permission", sym);
+               }
            }
          else if (Prob *pb = unsmob_prob (sys))
-           {
-             pb->set_property ("page-break-permission", sym);
-             /* backwards compatibility for the old page breaker */
-             pb->set_property ("penalty", scm_from_int (b ? -10001 : 10001));
-           }
+           pb->set_property ("page-break-permission", sym);
        }
     }
 }
@@ -374,6 +375,7 @@ Paper_book::systems ()
   
   systems_ = scm_reverse (systems_);
 
+  /* backwards compatibility for the old page breaker */
   int i = 0;
   Prob *last = 0;
   for (SCM s = systems_; scm_is_pair (s); s = scm_cdr (s))
@@ -386,6 +388,16 @@ Paper_book::systems ()
          && !scm_is_number (ps->get_property ("penalty")))
        ps->set_property ("penalty", scm_from_int (10000));
       last = ps;
+
+      if (scm_is_pair (scm_cdr (s)))
+       {
+         SCM perm = ps->get_property ("page-break-permission");
+         Prob *next = unsmob_prob (scm_cadr (s));
+         if (perm == SCM_EOL)
+           next->set_property ("penalty", scm_from_int (10001));
+         else if (perm == ly_symbol2scm ("force"))
+           next->set_property ("penalty", scm_from_int (-10001));
+       }
     }
 
   return systems_;
index 32dd2f367d36e0c37ee09e184584e52fc108d1fb..0649849b2111170163e66462afaca0a5fe00cc36 100644 (file)
@@ -404,13 +404,6 @@ System::get_paper_system ()
   pl->set_property ("page-break-penalty", right_bound->get_property ("page-break-penalty"));
   pl->set_property ("page-turn-penalty", right_bound->get_property ("page-turn-penalty"));
 
-  /* backwards compatibility with the old page breaker */
-  SCM perm = left_bound->get_property ("page-break-permission");
-  if (!scm_is_symbol (perm))
-    pl->set_property ("penalty", scm_from_double (10001));
-  else if (perm == ly_symbol2scm ("force"))
-    pl->set_property ("penalty", scm_from_double (-10001));
-  
   if (!scm_is_pair (pl->get_property ("refpoint-Y-extent")))
     {
       Interval staff_refpoints;