Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Side by Side Diff: lily/footnote-engraver.cc

Issue 4877041: Fixes footnote automatic numbering. (Closed)
Patch Set: Should not break regtests (and should work to boot!) Created 13 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | lily/grob.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 This file is part of LilyPond, the GNU music typesetter. 2 This file is part of LilyPond, the GNU music typesetter.
3 3
4 Copyright (C) 2011 Mike Solomon <mike@apollinemike.com> 4 Copyright (C) 2011 Mike Solomon <mike@apollinemike.com>
5 5
6 LilyPond is free software: you can redistribute it and/or modify 6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or 8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 LilyPond is distributed in the hope that it will be useful, 11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>. 17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
18 */ 18 */
19 19
20 #include "engraver.hh" 20 #include "engraver.hh"
21 21
22 #include "stream-event.hh" 22 #include "stream-event.hh"
23 #include "item.hh" 23 #include "item.hh"
24 #include "pointer-group-interface.hh" 24 #include "pointer-group-interface.hh"
25 #include "spanner.hh" 25 #include "spanner.hh"
26 #include "system.hh"
26 27
27 #include "translator.icc" 28 #include "translator.icc"
28 29
29 class Footnote_engraver : public Engraver 30 class Footnote_engraver : public Engraver
30 { 31 {
31 TRANSLATOR_DECLARATIONS (Footnote_engraver); 32 TRANSLATOR_DECLARATIONS (Footnote_engraver);
32 33
33 DECLARE_TRANSLATOR_LISTENER (footnote); 34 DECLARE_TRANSLATOR_LISTENER (footnote);
34 DECLARE_ACKNOWLEDGER (grob); 35 DECLARE_ACKNOWLEDGER (grob);
35 DECLARE_END_ACKNOWLEDGER (grob); 36 DECLARE_END_ACKNOWLEDGER (grob);
36 vector<Stream_event *> events_; 37 vector<Stream_event *> events_;
37 vector<Drul_array<Spanner *> > annotated_spanners_; 38 vector<Drul_array<Spanner *> > annotated_spanners_;
38 39
39 void stop_translation_timestep (); 40 void stop_translation_timestep ();
41 void finalize ();
40 42
41 void footnotify (Grob *, Stream_event *); 43 void footnotify (Grob *, Stream_event *);
42 }; 44 };
43 45
44 IMPLEMENT_TRANSLATOR_LISTENER (Footnote_engraver, footnote); 46 IMPLEMENT_TRANSLATOR_LISTENER (Footnote_engraver, footnote);
45 void 47 void
46 Footnote_engraver::listen_footnote (Stream_event *ev) 48 Footnote_engraver::listen_footnote (Stream_event *ev)
47 { 49 {
48 events_.push_back (ev); 50 events_.push_back (ev);
49 } 51 }
50 52
51 void 53 void
52 Footnote_engraver::stop_translation_timestep () 54 Footnote_engraver::stop_translation_timestep ()
53 { 55 {
54 events_.clear (); 56 events_.clear ();
55 } 57 }
56 58
59 void
60 Footnote_engraver::finalize ()
61 {
62 annotated_spanners_.resize (0);
63 }
64
57 Footnote_engraver::Footnote_engraver () 65 Footnote_engraver::Footnote_engraver ()
58 { 66 {
59 } 67 }
60 68
61 void 69 void
62 Footnote_engraver::footnotify (Grob *g, Stream_event *event) 70 Footnote_engraver::footnotify (Grob *g, Stream_event *event)
63 { 71 {
64 Spanner *s = dynamic_cast<Spanner *>(g); 72 Spanner *s = dynamic_cast<Spanner *>(g);
65 73
66 if (s) 74 if (s)
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 /* create */ 135 /* create */
128 "FootnoteItem " 136 "FootnoteItem "
129 "FootnoteSpanner ", 137 "FootnoteSpanner ",
130 138
131 /*read*/ 139 /*read*/
132 "currentMusicalColumn ", 140 "currentMusicalColumn ",
133 141
134 /*write*/ 142 /*write*/
135 "" 143 ""
136 ); 144 );
OLDNEW
« no previous file with comments | « no previous file | lily/grob.cc » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b