]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/change-iterator.cc
* scm/stencil.scm (fontify-text): reinstate function
[lilypond.git] / lily / change-iterator.cc
index ebd3426ac09bf19a0eedc68e03c2c27591f83f92..d36567b5940981cf5ee0dd2babbfcb8b4fce4060 100644 (file)
@@ -27,7 +27,7 @@ Change_iterator::error (String reason)
    */
   String warn2= "Change_iterator::process (): " 
     + get_outlet ()->context_name () + " = `"
-    + get_outlet ()->id_string_ + "': ";
+    + get_outlet ()->id_string () + "': ";
   warning (warn2);
   get_music ()->origin ()->warning (warn1);
 }
@@ -52,10 +52,10 @@ Change_iterator::process (Moment m)
   while (current && !current->is_alias (to_type))
     {
       last = current;
-      current = current->daddy_context_;
+      current = current->get_parent_context ();
     }
 
-  if (current && current->id_string_ == to_id)
+  if (current && current->id_string () == to_id)
     {
       String msg;
       msg += _ ("Can't switch translators, I'm there already");
@@ -64,16 +64,22 @@ Change_iterator::process (Moment m)
   if (current) 
     if (last)
       {
-       Context * dest = 
-         get_outlet ()->find_existing_context (to_type, to_id);
+       Context * dest = 0;
+       Context * where = get_outlet ();
+       while (!dest && where)
+         {
+           dest = find_context_below (where, to_type, to_id);
+           where = where->get_parent_context ();
+         }
+       
        if (dest)
          {
-       current->remove_context (last);
-       dest->add_context (last);
+           current->remove_context (last);
+           dest->add_context (last);
          }
        else
          {
-           get_music ()->origin ()->warning  ("Could not find context to switch to.");
+           get_music ()->origin ()->warning  ("could not find context to switch to.");
          }
       }
     else
@@ -82,7 +88,7 @@ Change_iterator::process (Moment m)
          We could change the current translator's id, but that would make 
          errors hard to catch
          
-          last->translator_id_string_  = get_change ()->change_to_id_string_;
+          last->translator_id_string ()  = get_change ()->change_to_id_string ();
        */
        error (_ ("I'm one myself"));
       }