X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fgroup-interface.cc;h=a62dde9a9c9f09fdea31a55f6e61761513629cb4;hb=7e72a1e50e94a7f9738d62599de79fe7745f600c;hp=74bd4ad75164eb07866d41ac8b9b3d796d61cb1b;hpb=af9078fd6d63dea5141e87a1b4d7cb5b0bcba84a;p=lilypond.git diff --git a/lily/group-interface.cc b/lily/group-interface.cc index 74bd4ad751..a62dde9a9c 100644 --- a/lily/group-interface.cc +++ b/lily/group-interface.cc @@ -3,58 +3,34 @@ source file of the GNU LilyPond music typesetter - (c) 1999--2001 Han-Wen Nienhuys + (c) 1999--2004 Han-Wen Nienhuys */ #include "group-interface.hh" #include "grob.hh" - -/* - This special add_thing routine is slightly more efficient than - - set_prop (name,cons (thing, get_prop (name))) - - since it can reuse the handle returned by scm_assq(). -*/ - void Group_interface::add_thing (Grob*me, SCM sym, SCM thing) { - SCM handle = scm_sloppy_assq (sym, me->mutable_property_alist_); - if (handle != SCM_BOOL_F) - { - gh_set_cdr_x (handle, gh_cons (thing, gh_cdr (handle))); - - } - else - { - /* - There is no mutable prop yet, so create an entry, and put it in front of the - mutable prop list. - */ - handle = scm_sloppy_assq (sym, me->immutable_property_alist_); - SCM tail = (handle != SCM_BOOL_F) ? gh_cdr(handle) : SCM_EOL; - me->mutable_property_alist_ = gh_cons (gh_cons (sym, gh_cons (thing, tail)), - me->mutable_property_alist_); - } + me->add_to_list_property (sym, thing); } + void Group_interface::add_thing (Grob*me, String name, SCM thing) { - add_thing (me, ly_symbol2scm (name.ch_C()), thing); + add_thing (me, ly_symbol2scm (name.to_str0 ()), thing); } int Group_interface::count (Grob *me, String name) { - return scm_ilength (me->get_grob_property (name.ch_C ())); + return scm_ilength (me->get_grob_property (name.to_str0 ())); } void -Pointer_group_interface::add_element (Grob*me, SCM name, Grob*p) +Pointer_group_interface::add_grob (Grob*me, SCM name, Grob*p) { Group_interface::add_thing (me, name, p->self_scm ()); }