From: fred Date: Sun, 24 Mar 2002 19:36:55 +0000 (+0000) Subject: lilypond-0.0.45 X-Git-Tag: release/1.5.59~5095 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a21c3cfeff942e758fc6ce6ee7efe24c62707eed;p=lilypond.git lilypond-0.0.45 --- diff --git a/lily/p-col.cc b/lily/p-col.cc index caaf264766..3ace8fba82 100644 --- a/lily/p-col.cc +++ b/lily/p-col.cc @@ -18,6 +18,7 @@ PCol::width() const int PCol::rank() const { +#if 0 if(!pscore_l_) return -1; PCursor me=pscore_l_->find_col( (PCol*)this); @@ -25,6 +26,19 @@ PCol::rank() const return -1; PCursor bot(pscore_l_->cols.top()); return me - bot; +#endif + assert(rank_i_ != -1); + return rank_i_; +} + +void +PCol::set_rank(int i) +{ + rank_i_ = i; + if (prebreak_p_) + prebreak_p_->rank_i_ = i; + if (postbreak_p_) + postbreak_p_->rank_i_ = i; } void @@ -34,7 +48,7 @@ PCol::print() const mtor << "PCol {"; if (rank() >= 0) - mtor << "rank: " << rank() << '\n'; + mtor << "rank: " << rank_i_ << '\n'; mtor << "# symbols: " << its.size() ; if (breakable_b()){ @@ -54,11 +68,7 @@ PCol::print() const int PCol::compare(PCol const &c1, PCol const &c2) { - PScore*ps_l = c1.pscore_l_; - PCursor ac(ps_l->find_col(&c1)); - PCursor bc(ps_l->find_col(&c2)); - assert(ac.ok() && bc.ok()); - return ac - bc; + return c1.rank() - c2.rank(); } void diff --git a/lily/p-score.cc b/lily/p-score.cc index 9e31523da1..800d3287cf 100644 --- a/lily/p-score.cc +++ b/lily/p-score.cc @@ -26,11 +26,15 @@ PScore::get_spacing(PCol*l, PCol*r) void PScore::clean_cols() { + int rank_i = 0; for (iter_top(cols,c); c.ok(); ) if (!c->used_b()) { delete c.remove_p(); - } else + } else { + c->set_rank(rank_i++); c++; + } + } @@ -248,6 +252,7 @@ void PScore::process() { clean_cols(); + *mlog << "Preprocessing ... " <