]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/p-col.cc
release: 0.0.74pre
[lilypond.git] / lily / p-col.cc
index e1c286da70cb3e83ae0a094084684952a2b32c6a..7036bebee37137dfbb7eeca436d90f40c69a7e14 100644 (file)
@@ -1,14 +1,14 @@
 /*
   p-col.cc -- implement PCol
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
 #include "p-col.hh"
 #include "p-score.hh"
-#include "p-staff.hh"
+
 #include "debug.hh"
 
 Interval
@@ -23,10 +23,21 @@ PCol::width() const
     return w;
 }
 
+void
+PCol::clean_breakable_items()
+{
+    if (!line_l_) {
+       its.junk_links();
+    }
+    if (prebreak_p_) 
+       prebreak_p_->clean_breakable_items();
+    if (postbreak_p_) 
+       postbreak_p_->clean_breakable_items();
+}
+
 int
-PCol::rank() const
+PCol::rank_i() const
 {
-    assert(rank_i_ != -1);
     return rank_i_;
 }
 
@@ -66,7 +77,7 @@ PCol::print() const
 int
 PCol::compare(PCol const &c1, PCol const &c2)
 {
-    return c1.rank() - c2.rank();
+    return c1.rank_i() - c2.rank_i();
 }
 
 void
@@ -93,6 +104,12 @@ PCol::set_breakable()
     postbreak_p_->pscore_l_ = pscore_l_;
 }
 
+bool
+PCol::breakpoint_b() const
+{
+    return !line_l_;
+}
+
 bool
 PCol::breakable_b() const
 {
@@ -101,6 +118,8 @@ PCol::breakable_b() const
 
 PCol::PCol(PCol *parent)
 {
+    used_b_ = false;
+    error_mark_b_ = false;
     daddy_l_ = parent;
     prebreak_p_=0;
     postbreak_p_=0;
@@ -126,5 +145,5 @@ PCol::add( Item *i)
 bool
 PCol::used_b()const
 {
-    return breakable_b() || its.size();
+    return breakable_b() || its.size()|| used_b_;
 }