]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/paper-column.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / paper-column.cc
index 3094f817593dfb1f13d3cc4ab786f8026c74fe93..525dca36b89fca5d7ee639d354f3d774b8d956fd 100644 (file)
@@ -95,7 +95,7 @@ Paper_column::is_used (Grob *me)
   if (bbm.size ())
     return true;
   
-  if (Item::is_breakable (me))
+  if (Paper_column::is_breakable (me))
     return true;
 
   if (to_boolean (me->get_property ("used")))
@@ -103,6 +103,12 @@ Paper_column::is_used (Grob *me)
   return false;
 }
 
+bool
+Paper_column::is_breakable (Grob *me)
+{
+  return scm_is_symbol (me->get_property ("line-break-permission"));
+}
+
 /*
   Print a vertical line and  the rank number, to aid debugging.
 */
@@ -113,10 +119,10 @@ Paper_column::print (SCM p)
 {
   Grob *me = unsmob_grob (p);
 
-  std::string r = to_string (Paper_column::get_rank (me));
+  string r = to_string (Paper_column::get_rank (me));
 
   Moment *mom = unsmob_moment (me->get_property ("when"));
-  std::string when = mom ? mom->to_string () : "?/?";
+  string when = mom ? mom->to_string () : "?/?";
 
   SCM properties = Font_interface::text_font_alist_chain (me);
 
@@ -157,16 +163,15 @@ Paper_column::before_line_breaking (SCM grob)
   if (!ga)
     return SCM_UNSPECIFIED;
 
-  Link_array<Grob> &array (ga->array_reference ());
+  vector<Grob*> &array (ga->array_reference ());
 
   for (vsize i = array.size (); i--;)
     {
       Grob *g = array[i];
 
       if (!g || !g->is_live ())
-       {                       // UGH . potentially quadratic.
-         array.del (i);
-       }
+       /* UGH . potentially quadratic. */
+       array.erase (array.begin () + i);
     }
 
   return SCM_UNSPECIFIED;
@@ -194,7 +199,12 @@ ADD_INTERFACE (Paper_column,
               "between-cols "
               "bounded-by-me "
               "line-break-system-details "
-              "page-penalty "
+              "line-break-penalty "
+              "line-break-permission "
+              "page-break-penalty "
+              "page-break-permission "
+              "page-turn-penalty "
+              "page-turn-permission "
               "shortest-playing-duration "
               "shortest-starter-duration "
               "used "