]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lyric-engraver.cc
Doc: Glossary - add notes for High Bass Clef
[lilypond.git] / lily / lyric-engraver.cc
index 58b8f6cdd294e7a6a17907d75c8e4e9418d3c542..bc576bf3ccc669f23fbea53df01ce072c069549b 100644 (file)
@@ -96,7 +96,10 @@ get_voice_to_lyrics (Context *lyrics)
 
   SCM avc = lyrics->get_property ("associatedVoiceContext");
   if (Context *c = unsmob<Context> (avc))
-    return c;
+    {
+      if (!c->is_removable ())
+        return c;
+    }
 
   SCM voice_name = lyrics->get_property ("associatedVoice");
   string nm = lyrics->id_string ();
@@ -116,26 +119,11 @@ get_voice_to_lyrics (Context *lyrics)
   if (!scm_is_symbol (voice_type))
     return 0;
 
-  Context *parent = lyrics;
-  Context *voice = 0;
-  while (parent && !voice)
-    {
-      voice = find_context_below (parent, voice_type, nm);
-      parent = parent->get_parent_context ();
-    }
-
+  Context *voice = find_context_near (lyrics, voice_type, nm);
   if (voice)
     return voice;
 
-  parent = lyrics;
-  voice = 0;
-  while (parent && !voice)
-    {
-      voice = find_context_below (parent, voice_type, "");
-      parent = parent->get_parent_context ();
-    }
-
-  return voice;
+  return find_context_near (lyrics, voice_type, "");
 }
 
 Grob *