source file of the GNU LilyPond music typesetter
- (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include "grob.hh"
return grob_stencil_extent (me, X_AXIS);
}
+Stream_event*
+Grob::event_cause ()
+{
+ SCM cause = get_property ("cause");
+ if (to_boolean (Stream_event::smob_p (cause)))
+ return unsmob_stream_event (cause);
+ else if (to_boolean (Grob::smob_p (cause)))
+ return unsmob_grob (cause)->event_cause ();
+ return 0;
+}
Grob *
common_refpoint_of_list (SCM elist, Grob *common, Axis a)
Grob *
common_refpoint_of_array (vector<Grob*> const &arr, Grob *common, Axis a)
{
- for (vsize i = arr.size (); i--;)
- if (Grob *s = arr[i])
- {
- if (common)
- common = common->common_refpoint (s, a);
- else
- common = s;
- }
+ for (vsize i = 0; i < arr.size (); i++)
+ if (common)
+ common = common->common_refpoint (arr[i], a);
+ else
+ common = arr[i];
return common;
}