]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/translator-group.cc
* Apply patch from 77c34ddc (Werner Lemberg <wl@gnu.org>)
[lilypond.git] / lily / translator-group.cc
index fb6d2580ed09bf2b50461104272e633bee972220..1980da53d05611cf6db3e2f1d95afa9bc758526f 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>,
+  (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>,
                  Erik Sandberg <mandolaerik@gmail.com>
 */
 
@@ -141,15 +141,21 @@ Translator_group::create_child_translator (SCM sev)
 
   for (SCM s = trans_names; scm_is_pair (s); s = scm_cdr (s))
     {
-      Translator *type = get_translator (scm_car (s));
+      SCM definition = scm_car (s);
+
+      Translator *type = 0;
+      if (ly_is_symbol (definition))
+       type = get_translator (definition);
+        
       if (!type)
        warning (_f ("cannot find: `%s'", ly_symbol2string (scm_car (s)).c_str ()));
       else
        {
-         Translator *tr = type->clone ();
-         SCM str = tr->self_scm ();
+         Translator *instance = type->clone ();
+
+         SCM str = instance->self_scm ();
 
-         if (tr->must_be_last ())
+         if (instance->must_be_last ())
            {
              SCM cons = scm_cons (str, SCM_EOL);
              if (scm_is_pair (trans_list))
@@ -160,8 +166,8 @@ Translator_group::create_child_translator (SCM sev)
          else
            trans_list = scm_cons (str, trans_list);
 
-         tr->daddy_context_ = new_context;
-         tr->unprotect ();
+         instance->daddy_context_ = new_context;
+         instance->unprotect ();
        }
     }