]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/translator-group.cc
Run `make grand-replace'.
[lilypond.git] / lily / translator-group.cc
index da3fda5ed5bbeb12cca478346fec0f5239662ceb..fb6d2580ed09bf2b50461104272e633bee972220 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>,
+  (c) 1997--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>,
                  Erik Sandberg <mandolaerik@gmail.com>
 */
 
 #include "output-def.hh"
 #include "performer-group.hh"
 #include "scm-hash.hh"
-#include "stream-event.hh"
 #include "warn.hh"
 
-Translator_group *
-Translator_group::get_daddy_translator () const
-{
-  return context ()->get_parent_context ()->implementation ();
-}
 
 void
 translator_each (SCM list, Translator_method method)
@@ -149,7 +143,7 @@ Translator_group::create_child_translator (SCM sev)
     {
       Translator *type = get_translator (scm_car (s));
       if (!type)
-       warning (_f ("can't find: `%s'", ly_symbol2string (scm_car (s)).c_str ()));
+       warning (_f ("cannot find: `%s'", ly_symbol2string (scm_car (s)).c_str ()));
       else
        {
          Translator *tr = type->clone ();
@@ -202,7 +196,7 @@ precomputed_recurse_over_translators (Context *c, Translator_precompute_index id
   Translator_group *tg
     = dynamic_cast<Translator_group *> (c->implementation ());
 
-  if (dir == DOWN)
+  if (tg && dir == DOWN)
     {
       tg->precomputed_translator_foreach (idx);
       tg->call_precomputed_self_method (idx);
@@ -212,7 +206,7 @@ precomputed_recurse_over_translators (Context *c, Translator_precompute_index id
        s = scm_cdr (s))
     precomputed_recurse_over_translators (unsmob_context (scm_car (s)), idx, dir);
 
-  if (dir == UP)
+  if (tg && dir == UP)
     {
       tg->precomputed_translator_foreach (idx);
       tg->call_precomputed_self_method (idx);
@@ -220,12 +214,13 @@ precomputed_recurse_over_translators (Context *c, Translator_precompute_index id
 }
 
 void
-recurse_over_translators (Context *c, Translator_method ptr, Translator_group_method tg_ptr, Direction dir)
+recurse_over_translators (Context *c, Translator_method ptr,
+                         Translator_group_method tg_ptr, Direction dir)
 {
   Translator_group *tg
     = dynamic_cast<Translator_group *> (c->implementation ());
 
-  if (dir == DOWN)
+  if (tg && dir == DOWN)
     {
       (tg->*tg_ptr) ();
       translator_each (tg->get_simple_trans_list (), ptr);
@@ -235,7 +230,7 @@ recurse_over_translators (Context *c, Translator_method ptr, Translator_group_me
        s = scm_cdr (s))
     recurse_over_translators (unsmob_context (scm_car (s)), ptr, tg_ptr, dir);
 
-  if (dir == UP)
+  if (tg && dir == UP)
     {
       translator_each (tg->get_simple_trans_list (),
                       ptr);