- Grob * sc = broken_intos_[i];
- System * l = sc->get_system ();
- set_break_subsititution (l ? l->self_scm (): SCM_UNDEFINED);
-
- SCM newval = SCM_EOL;
- SCM * tail = &newval;
-
- for (int k = 0; k < 2;k++)
- for (int j = (*arrs[k])[i][LEFT]; j <= (*arrs[k])[i][RIGHT]; j++)
- {
- SCM subs =substitute_grob (vec[j].grob_);
- if (subs!= SCM_UNDEFINED)
- {
- *tail = scm_cons (subs, SCM_EOL);
-
- tail = SCM_CDRLOC (*tail);
- }
-
- }
-
+ for (int j = vec[i].left_; j <= vec[i].right_; j++)
+ item_indices[j - system_range[LEFT]].add_point (i);
+ }
+
+ /*
+ sorting vec[spanner_index.. len]
+ is a waste of time -- the staff-spanners screw up the
+ ordering, since they go across the entire score.
+ */
+ for (vsize i = spanner_indices.size (); i--;)
+ spanner_indices[i] = Slice (spanner_index, len - 1);
+
+ assert (item_index <= spanner_index);
+
+ assert ((broken_intos_.size () == (vsize)system_range.length () + 1)
+ || (broken_intos_.empty () && system_range.length () == 0));
+ for (vsize i = 0; i < broken_intos_.size (); i++)
+ {
+ Grob *sc = broken_intos_[i];
+ System *l = sc->get_system ();
+ set_break_subsititution (l ? l->self_scm () : SCM_UNDEFINED);
+
+ SCM newval = sc->internal_get_object (sym);
+ if (!Grob_array::is_smob (newval))
+ {
+ newval = Grob_array::make_array ();
+ sc->set_object (sym, newval);
+ }
+
+ Grob_array *new_array = Grob_array::unsmob (newval);
+ for (int k = 0; k < 2; k++)
+ for (int j = (*arrs[k])[i][LEFT]; j <= (*arrs[k])[i][RIGHT]; j++)
+ {
+ Grob *substituted = substitute_grob (vec[j].grob_);
+ if (substituted)
+ new_array->add (substituted);
+ }
+