From: Han-Wen Nienhuys Date: Sun, 24 Feb 2008 00:07:14 +0000 (-0300) Subject: Fix #532. X-Git-Tag: release/2.11.41-1~9 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f5053e6c3e87ff57a4781a7e69fb1ca514c553f1;p=lilypond.git Fix #532. In case that the lyrics name is "", don't go looking for an associated voice. --- diff --git a/input/regression/lyric-no-association-rhythm.ly b/input/regression/lyric-no-association-rhythm.ly new file mode 100644 index 0000000000..782d48614b --- /dev/null +++ b/input/regression/lyric-no-association-rhythm.ly @@ -0,0 +1,26 @@ + +\header { + + texidoc = "When lyrics are not associated with specific voices, the + lyric placement should follow lyric rhythms. In particular, the + second syllable here should not be attached to the first note of the first staff." + +} + + +\version "2.11.40" +\layout { ragged-right = ##t } + +\score { + \context ChoirStaff << + \context Staff = soprano << + \context Voice = sop \relative c' { e2 e4 } + >> + \context Staff = alto << + \context Voice = alt \relative c' { e4 e4 e4 } + \new Lyrics \lyricmode { + do4 re4 me4 + } + >> + >> +} diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index 88b954f4fa..ce13839089 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -83,6 +83,10 @@ get_voice_to_lyrics (Context *lyrics) if (scm_is_string (voice_name)) nm = ly_scm2string (voice_name); + else if (nm == "") + { + return 0; + } else { ssize idx = nm.rfind ('-'); @@ -142,7 +146,7 @@ Lyric_engraver::stop_translation_timestep () if (text_) { Context *voice = get_voice_to_lyrics (context ()); - + if (voice) { Grob *head = get_current_note_head (voice);