X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Faxis-group-spanner.cc;h=fdd2969b5e359964ec913c6dc76c6fda3b05d250;hb=31653bf1d61a33ef8bc8c871d60c6b3452d04d28;hp=70c70c297f063bee6db0af7b60a6fd1e89900441;hpb=4a8e84ba5dc1f8b71fda44b848b601349a80403a;p=lilypond.git diff --git a/lily/axis-group-spanner.cc b/lily/axis-group-spanner.cc index 70c70c297f..fdd2969b5e 100644 --- a/lily/axis-group-spanner.cc +++ b/lily/axis-group-spanner.cc @@ -65,39 +65,36 @@ Axis_group_spanner::do_break_processing() /* this piece doesn't know where it belongs. Find out if it was broken, and use the broken remains */ - if (dynamic_cast (elt)) + Spanner * sp =dynamic_cast (elt); + Item *it = dynamic_cast (elt) ; + if (sp) { - Spanner * sp = dynamic_cast (elt); - for (int j =0; j < broken_into_l_arr_.size(); j++) { Axis_group_spanner * my_broken_l - = (Axis_group_spanner*)broken_into_l_arr_[j]; + = dynamic_cast(broken_into_l_arr_[j]); Spanner * broken_span_l - = sp->find_broken_piece ( - ((Score_element*)my_broken_l)->line_l()); + = sp->find_broken_piece (dynamic_cast(my_broken_l)->line_l()); if (broken_span_l) my_broken_l->add_element (broken_span_l); } } - else if (dynamic_cast (elt) - && dynamic_cast (elt)->breakable_b_ - && dynamic_cast (elt)->break_status_dir () == 0) + else if (it && it->breakable_b_ && it->break_status_dir () == 0) { // broken items Direction j=LEFT; do { - Item * my_item = dynamic_cast (elt)->broken_to_drul_[j]; + Item * my_item = it->broken_to_drul_[j]; Line_of_score * item_line_l = my_item->line_l() ; if (! item_line_l) continue; Axis_group_spanner * v - = (Axis_group_spanner*)find_broken_piece (item_line_l); + = dynamic_cast(find_broken_piece (item_line_l)); if (v) v->add_element (my_item); else @@ -118,7 +115,7 @@ Axis_group_spanner::do_break_processing() Put it in appropriate piece of this spanner */ Axis_group_spanner * my_broken_l - = (Axis_group_spanner*)find_broken_piece (elt->line_l()); + = dynamic_cast (find_broken_piece (elt->line_l())); my_broken_l->add_element (elt); } }