]> git.donarmstrong.com Git - lilypond.git/blob - lily/horizontal-group-item.cc
release: 0.1.1
[lilypond.git] / lily / horizontal-group-item.cc
1 /*
2   horizontal-group-item.cc -- implement Horizontal_group_item
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "p-col.hh"
10 #include "horizontal-group-item.hh"
11
12 IMPLEMENT_IS_TYPE_B2(Horizontal_group_item, Horizontal_group, Item);
13
14 void
15 Horizontal_group_item::OK() const
16 {
17     for (int i=0; i < elem_l_arr_.size(); i++) {
18         Item * it_l = elem_l_arr_[i]->item();
19         
20         assert(it_l&& it_l->pcol_l_ == pcol_l_ );
21     }
22 }
23
24 void
25 Horizontal_group_item::do_breakable_col_processing()
26 {
27     if (!pcol_l_->breakable_b())
28         return;
29     OK();
30     copy_breakable_items();
31     
32     Link_array<Score_elem> elems = elem_l_arr_;
33
34     for (int i=0; i < elems.size(); i++) {
35         Item* it_l = elems[i]->item();
36         for ( int j=0; j < 2; j++) {
37             Item *new_l = it_l->find_prebroken_piece(broken_to_a_[j]->pcol_l_);
38             ((Horizontal_group_item*)broken_to_a_[j])->add_element( new_l );
39         }
40     }
41 }