X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ftweak-engraver.cc;h=d6fb7855224349f018e762cc23aea1c13ed6cc14;hb=468619111ee6009098c318243e53d98cb884ef2c;hp=1f4f75d870cbfe756bc2f02ab5966f66ad384c22;hpb=55ac733b69643a6bc6a83b706c65cb56efd388ef;p=lilypond.git diff --git a/lily/tweak-engraver.cc b/lily/tweak-engraver.cc index 1f4f75d870..d6fb785522 100644 --- a/lily/tweak-engraver.cc +++ b/lily/tweak-engraver.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2005--2011 Han-Wen Nienhuys + Copyright (C) 2005--2012 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify @@ -39,28 +39,41 @@ Tweak_engraver::Tweak_engraver () void Tweak_engraver::acknowledge_grob (Grob_info info) { - if (Stream_event *ev = info.event_cause ()) + Stream_event *ev = info.event_cause (); + bool direct = ev; + SCM grobname = SCM_UNDEFINED; + if (!direct) + ev = info.ultimate_event_cause (); + if (ev) { for (SCM s = ev->get_property ("tweaks"); - scm_is_pair (s); s = scm_cdr (s)) - { - info.grob ()->set_property (scm_caar (s), scm_cdar (s)); - } + scm_is_pair (s); s = scm_cdr (s)) + { + if (scm_is_pair (scm_caar (s))) + { + if (SCM_UNBNDP (grobname)) + grobname = scm_from_locale_symbol (info.grob ()->name ().c_str ()); + if (scm_is_eq (scm_caaar (s), grobname)) + info.grob ()->set_property (scm_cdaar (s), scm_cdar (s)); + } + else if (direct) + info.grob ()->set_property (scm_caar (s), scm_cdar (s)); + } } } ADD_ACKNOWLEDGER (Tweak_engraver, grob); ADD_TRANSLATOR (Tweak_engraver, - /* doc */ - "Read the @code{tweaks} property from the originating event," - " and set properties.", - - /* create */ - "", + /* doc */ + "Read the @code{tweaks} property from the originating event," + " and set properties.", - /* read */ - "", + /* create */ + "", - /* write */ - "" - ); + /* read */ + "", + + /* write */ + "" + );