On Sun, 2008-08-10 at 01:06 +0100, Neil Puttock wrote: > 2008/8/9 Han-Wen Nienhuys <[EMAIL PROTECTED]>: > > This does not make sense to me at all. line-positions is a property > > of the staff symbol, as is line-count. If someone is calling > > > > Staff_symbol::on_line(x, y) > > > > where x is not in fact the staff-symbol, then that is an error in the > > caller. > > It's only called indirectly through Staff_symbol_referencer::on_line (). > > Before the patch was applied, Staff_symbol_referencer::on_line () > looked like this: > > bool > Staff_symbol_referencer::on_line (Grob *me, int pos) > { > int sz = line_count (me) - 1; > return ((pos + sz) % 2) == 0; > } > > Though it's called by objects which aren't staff-symbol, > Staff_symbol_referencer::line_count () made sure it retrieved the > staff-symbol, if present: > > int > Staff_symbol_referencer::line_count (Grob *me) > { > Grob *st = get_staff_symbol (me); > return st ? Staff_symbol::line_count (st) : 0; > }
I think Han-Wen's point is that the first argument to Staff_symbol::some_function(Grob *me, ...) should always be a staff symbol (whereas the first argument to Staff_symbol_referencer::some_function(Grob *me, ...) should be a staff symbol referencer). In other words, the old code was ok but it isn't ok for Staff_symbol::on_line to accept something that isn't a staff symbol. Joe _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user