- {
- Drul_array<Item *> bounds;
- bounds[LEFT] = break_points[i - 1];
- bounds[RIGHT] = break_points[i];
- Direction d = LEFT;
- do
- {
- if (!bounds[d]->get_system ())
- bounds[d] = bounds[d]->find_prebroken_piece (- d);
- }
- while ((flip (&d)) != LEFT);
-
- if (!bounds[LEFT] || ! bounds[RIGHT])
- {
- programming_error ("bounds of this piece aren't breakable. ");
- continue;
- }
-
- bool ok = parent_rank_slice.contains (bounds[LEFT]->get_column ()->get_rank ());
- ok = ok && parent_rank_slice.contains (bounds[RIGHT]->get_column ()->get_rank ());
-
- if (!ok)
- {
- programming_error (to_string ("Spanner `%s' is not fully contained in parent spanner. Ignoring orphaned part",
- name ().c_str ()));
- continue;
- }
-
-
- Spanner *span = dynamic_cast<Spanner *> (clone ());
- span->set_bound (LEFT, bounds[LEFT]);
- span->set_bound (RIGHT, bounds[RIGHT]);
-
- if (!bounds[LEFT]->get_system ()
- || !bounds[RIGHT]->get_system ()
- || bounds[LEFT]->get_system () != bounds[RIGHT]->get_system ())
- {
- programming_error ("bounds of spanner are invalid");
- span->suicide ();
- }
- else
- {
- bounds[LEFT]->get_system ()->typeset_grob (span);
- broken_intos_.push_back (span);
- }
- }
+ {
+ Drul_array<Item *> bounds;
+ bounds[LEFT] = break_points[i - 1];
+ bounds[RIGHT] = break_points[i];
+ for (LEFT_and_RIGHT (d))
+ {
+ if (!bounds[d]->get_system ())
+ bounds[d] = bounds[d]->find_prebroken_piece (- d);
+ }
+
+ if (!bounds[LEFT] || ! bounds[RIGHT])
+ {
+ programming_error ("bounds of this piece aren't breakable.");
+ continue;
+ }
+
+ bool ok = parent_rank_slice.contains (bounds[LEFT]->get_column ()->get_rank ());
+ ok = ok && parent_rank_slice.contains (bounds[RIGHT]->get_column ()->get_rank ());
+
+ if (!ok)
+ {
+ programming_error (to_string ("Spanner `%s' is not fully contained in parent spanner."
+ " Ignoring orphaned part",
+ name ().c_str ()));
+ continue;
+ }
+
+ Spanner *span = dynamic_cast<Spanner *> (clone ());
+ span->set_bound (LEFT, bounds[LEFT]);
+ span->set_bound (RIGHT, bounds[RIGHT]);
+
+ if (!bounds[LEFT]->get_system ()
+ || !bounds[RIGHT]->get_system ()
+ || bounds[LEFT]->get_system () != bounds[RIGHT]->get_system ())
+ {
+ programming_error ("bounds of spanner are invalid");
+ span->suicide ();
+ }
+ else
+ {
+ bounds[LEFT]->get_system ()->typeset_grob (span);
+ broken_intos_.push_back (span);
+ }
+ }