]> git.donarmstrong.com Git - lilypond.git/commitdiff
(Global_context): alway accept Score
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 27 Feb 2004 11:26:33 +0000 (11:26 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 27 Feb 2004 11:26:33 +0000 (11:26 +0000)
(run_iterator_on_me): cast Context to Score_context, not
Context_def.

ChangeLog
lily/global-context.cc

index 7067df67dedd03c23cca9a87d0faaf39197d7647..ac0992228aadd46ced72c6d7f973c50271d6a346 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-02-27  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/global-context.cc (Global_context): alway accept Score
+       (run_iterator_on_me): cast Context to Score_context, not
+       Context_def.
+
        * Documentation/user/refman.itely: documentation patch by Edward
        Sanford Sutton.
 
index 7e91b89c36a5a3669236e76961bcafaab7b0f889..7ea4f98732e6061e1cf1e56dbbc1ca1795b5fe60 100644 (file)
@@ -22,6 +22,7 @@ Global_context::Global_context (Music_output_def*o)
   output_def_ = o;
   definition_ = o->find_context_def (ly_symbol2scm ("Global"));
   unsmob_context_def (definition_)->apply_default_property_operations (this);
+  accepts_list_ = scm_list_1 (ly_symbol2scm ("Score"));
 }
 
 Music_output_def* 
@@ -147,10 +148,11 @@ Global_context::run_iterator_on_me (Music_iterator * iter)
                                                ->find_context_def (key));
          if (!t)
            error (_f ("can't find `%s' context", "Score"));
-         
-         add_context (t->instantiate (SCM_EOL));
 
-         Score_context *sc = dynamic_cast<Score_context*> (t);
+         Context *c = t->instantiate (SCM_EOL);
+         add_context (c);
+
+         Score_context *sc = dynamic_cast<Score_context*> (c);
          sc->prepare (w);
        }