X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=blobdiff_plain;f=lily%2Fscore-element.cc;h=48dd8be722e941476e21303b98a4c3b886eb2305;hb=51e7345f199657c7b868d5653f209703e897fca8;hp=891f67e09272121f71a0fa2a24e484c82fe4bd0e;hpb=7a56da508e9968e2d897baab104cd1da82b779d6;p=lilypond.git diff --git a/lily/score-element.cc b/lily/score-element.cc index 891f67e092..48dd8be722 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -27,6 +27,7 @@ #include "dimension-cache.hh" #include "side-position-interface.hh" #include "item.hh" + /* TODO: @@ -291,7 +292,9 @@ Score_element::do_add_processing() } - +/* + ugh. + */ Molecule Score_element::do_brew_molecule() const { @@ -353,18 +356,17 @@ Score_element::handle_broken_smobs (SCM src, SCM criterion) Direction d = to_dir (criterion); if (i && i->break_status_dir () != d) { - Item *br = i->find_broken_piece (d); + Item *br = i->find_prebroken_piece (d); return (br) ? br->self_scm_ : SCM_UNDEFINED; } } else { - Line_of_score * line = dynamic_cast (unsmob_element ( criterion)); - Line_of_score * dep_line = sc->line_l (); + Line_of_score * dep_line = sc->line_l (); if (dep_line != line) { - Score_element * br = sc->find_broken_piece (line); + Score_element * br = sc->find_broken_piece (line); return (br) ? br->self_scm_ : SCM_UNDEFINED; } if (!dep_line) @@ -393,7 +395,8 @@ Score_element::handle_broken_smobs (SCM src, SCM criterion) return handle_broken_smobs (cdr, criterion); - We don't want to rely on the compiler to do this. */ + We don't want to rely on the compiler to do this. Without + tail-recursion, this easily crashes with a stack overflow. */ src = cdr; goto again; } @@ -439,34 +442,19 @@ Score_element::handle_broken_dependencies() /* This element is `invalid'; it has been removed from all dependencies, so let's junk the element itself. - */ element_property_alist_ = SCM_EOL; set_extent_callback (0, Y_AXIS); set_extent_callback (0, X_AXIS); } - - } - -/* - TODO: cleanify. - */ void Score_element::handle_prebroken_dependencies() { - if (Item*i =dynamic_cast (this)) - { - if (original_l_) - { - element_property_alist_ - = handle_broken_smobs (original_l_->element_property_alist_, - gh_int2scm (i->break_status_dir ())); - } - } } + bool Score_element::linked_b() const { @@ -625,7 +613,7 @@ Score_element::fixup_refpoint () Direction my_dir = i->break_status_dir () ; if (my_dir!= parenti->break_status_dir()) { - Item *newparent = parenti->find_broken_piece (my_dir); + Item *newparent = parenti->find_prebroken_piece (my_dir); set_parent (newparent, ax); } } @@ -639,7 +627,6 @@ Score_element::fixup_refpoint () SMOB funcs ****************************************************/ - #include "ly-smobs.icc" IMPLEMENT_UNSMOB(Score_element, element);