X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fproperty-iterator.cc;h=6352f16399b92a41438de83cf639e6a40e679da5;hb=9a9b94b7305e415bc519393d57dd6c5830661a97;hp=5f8b8c408e6e5e8e23e6bb263136800a03e22c14;hpb=4a401ca1c60f428daa242dbdd102fdb3f327ebfb;p=lilypond.git diff --git a/lily/property-iterator.cc b/lily/property-iterator.cc index 5f8b8c408e..6352f16399 100644 --- a/lily/property-iterator.cc +++ b/lily/property-iterator.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2011 Han-Wen Nienhuys + Copyright (C) 1997--2012 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,14 +35,21 @@ Property_iterator::process (Moment mom) { Context *o = get_outlet (); Music *m = get_music (); - SCM previous_value = o->get_property (m->get_property ("symbol")); + bool once = to_boolean (m->get_property ("once")); + SCM symbol = m->get_property ("symbol"); + SCM previous_value = SCM_UNDEFINED; + if (once) { + Context *w = o->where_defined (symbol, &previous_value); + if (o != w) + previous_value = SCM_UNDEFINED; + } send_stream_event (o, "SetProperty", m->origin (), - ly_symbol2scm ("symbol"), m->get_property ("symbol"), + ly_symbol2scm ("symbol"), symbol, ly_symbol2scm ("value"), m->get_property ("value")); /* For \once \set install a finalization hook to reset the property to the * previous value after the timestep */ - if (to_boolean (m->get_property ("once"))) + if (once) { Global_context *tg = get_outlet ()->get_global_context (); tg->add_finalization (scm_list_n (once_finalization_proc,