X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ftie.cc;h=dcc53ad44e61c7af5ee5522ce3d8b18a19b56eb4;hb=8e2eaf4959bec63a1128a444591a540f4f1e2937;hp=ae81317e392665ac08cca89a1926e7853c342f04;hpb=0a34e892b31530e87380bffaac0bb9cf9a1c8a91;p=lilypond.git diff --git a/lily/tie.cc b/lily/tie.cc index ae81317e39..dcc53ad44e 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -45,13 +45,20 @@ bool Tie::less (Grob *g1, Grob *g2) { Spanner *s1 = dynamic_cast (g1); + if (!s1) + { + g1->programming_error ("grob is not a tie"); + return false; + } + Spanner *s2 = dynamic_cast (g2); - if (s1 && s2) { - return get_position (s1) < get_position (s2); - } + if (!s2) + { + g2->programming_error ("grob is not a tie"); + return true; + } - programming_error ("grob is not a tie"); - return false; + return get_position (s1) < get_position (s2); } void @@ -64,7 +71,7 @@ Item * Tie::head (Spanner *me, Direction d) { Item *it = me->get_bound (d); - return Note_head::has_interface (it) ? it : 0; + return has_interface (it) ? it : 0; } int @@ -146,8 +153,8 @@ Tie::calc_direction (SCM smob) // types. It might be clearer to use a template. Grob *me = unsmob (smob); Grob *yparent = me->get_parent (Y_AXIS); - if ((Tie_column::has_interface (yparent) - || Semi_tie_column::has_interface (yparent)) + if ((has_interface (yparent) + || has_interface (yparent)) && unsmob (yparent->get_object ("ties")) // && unsmob (yparent->get_object ("ties"))->size () > 1 ) @@ -209,8 +216,8 @@ Tie::calc_control_points (SCM smob) Spanner *me = LY_ASSERT_SMOB(Spanner, smob, 1); Grob *yparent = me->get_parent (Y_AXIS); - if ((Tie_column::has_interface (yparent) - || Semi_tie_column::has_interface (yparent)) + if ((has_interface (yparent) + || has_interface (yparent)) && unsmob (yparent->get_object ("ties"))) { extract_grob_set (yparent, "ties", ties);