From: Mike Solomon Date: Fri, 15 Jun 2012 06:34:33 +0000 (+0200) Subject: Removes duplicate footnote-interface implementing grobs from all_elements_ X-Git-Tag: release/2.15.41-1~47 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=251895f1816cf77d9caf9f5e1b3b53ea7c5c8d3b;p=lilypond.git Removes duplicate footnote-interface implementing grobs from all_elements_ --- diff --git a/input/regression/footnote-break-visibility.ly b/input/regression/footnote-break-visibility.ly index 0f88e2df27..4626553982 100644 --- a/input/regression/footnote-break-visibility.ly +++ b/input/regression/footnote-break-visibility.ly @@ -18,7 +18,7 @@ This behavior can be overridden. \time 3/4 \break \pageBreak c2. - \once \override Staff . FootnoteItem #'break-visibility = ##(#f #f #t) + \once \override Score . FootnoteItem #'break-visibility = ##(#f #f #t) \footnote "foo" #'(0 . 2) #'TimeSignature "bar" \default \time 4/4 \break \pageBreak diff --git a/lily/system.cc b/lily/system.cc index fdcc2b133d..be3c9ec192 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -254,6 +254,12 @@ System::get_footnote_grobs_in_range (vsize start, vsize end) if (Item *item = dynamic_cast(at_bat)) { + /* + We use this to weed out grobs that fall at the end + of the line when we want grobs at the beginning. + */ + end_of_line_visible = item->break_status_dir () == LEFT; + if (!Item::break_visible (item)) continue; // safeguard to bring down the column rank so that end of line footnotes show up on the correct line @@ -275,6 +281,14 @@ System::get_footnote_grobs_in_range (vsize start, vsize end) continue; if (!at_bat->is_live ()) continue; + /* + TODO + Sometimes, there are duplicate entries in the all_elements_ + list. In a separate patch, this practice should be squashed + so that the check below can be eliminated. + */ + if (find (out.begin (), out.end (), at_bat) != out.end ()) + continue; out.push_back (at_bat); }