]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/property-iterator.cc
Merge remote-tracking branch 'origin/translation'
[lilypond.git] / lily / property-iterator.cc
index 5f8b8c408e6e5e8e23e6bb263136800a03e22c14..53d88d548ca6544f5f8c00ec075dcced72cf54ac 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   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,