- if (item_l->empty_b (X_AXIS) || item_l->parent_l (X_AXIS))
- return;
-
- SCM bp=item_l->get_grob_property ("breakable");
- bool breakable = (to_boolean (bp));
- if (!breakable)
- return ;
-
- SCM align_name = item_l->get_grob_property ("break-align-symbol");
- if (!gh_symbol_p (align_name))
- return ;
-
- if (!align_l_)
- {
- align_l_ = new Item (get_property ("BreakAlignment"));
- Break_align_interface::set_interface (align_l_);
- announce_grob (align_l_,0);
-
- SCM edge_sym = ly_symbol2scm ("Left_edge_item");
- Item * edge = new Item (get_property ("LeftEdge"));
-
-
-
- /*
- If the element is empty, it will be ignored in the break
- alignment stuff.
-
- TODO: switch off ignoring empty stuff?
- */
- edge->set_extent_callback (Grob::point_dimension_callback_proc, X_AXIS);
-
- /*
- We must have left-edge in the middle. Instrument-names
- are left to left-edge, so they don't enter the staff.
- */
- align_l_->set_grob_property ("self-alignment-X", edge->self_scm ());
-
- announce_grob (edge, 0);
- column_alist_ = scm_assoc_set_x (column_alist_, edge_sym, edge->self_scm ());
- }
-
- SCM s = scm_assoc (align_name, column_alist_);
-
- Item * group = 0;
-
- if (s != SCM_BOOL_F)
- {
- Grob *e = unsmob_grob (ly_cdr (s));
- group = dynamic_cast<Item*> (e);
- }
- else
- {
- group = new Item (get_property ("BreakAlignGroup"));
-
- Axis_group_interface::set_interface (group);
- Axis_group_interface::set_axes (group, X_AXIS,X_AXIS);
-
- group->set_grob_property ("break-align-symbol", align_name);
- group->set_parent (align_l_, Y_AXIS);
- announce_grob (group, 0);
- column_alist_ = scm_assoc_set_x (column_alist_, align_name, group->self_scm ());
-
- }
- Axis_group_interface::add_element (group, item_l);
+ group = make_item ("BreakAlignGroup", item->self_scm ());
+
+ group->set_property ("break-align-symbol", align_name);
+ group->set_parent (align_, Y_AXIS);
+
+ column_alist_ = scm_assoc_set_x (column_alist_, align_name, group->self_scm ());
+
+ Break_alignment_interface::add_element (align_, group);