+ if (Item *rb = right_col->find_prebroken_piece (LEFT))
+ musical_column_spacing (me, left_col, rb, options);
+ }
+ else
+ {
+ /*
+ The case that the right part is broken as well is rather
+ rare, but it is possible, eg. with a single empty measure,
+ or if one staff finishes a tad earlier than the rest.
+ */
+ Item *lb = left_col->find_prebroken_piece (RIGHT);
+ Item *rb = right_col->find_prebroken_piece (LEFT);
+
+ if (left_col && right_col)
+ breakable_column_spacing (me, left_col, right_col, options);
+
+ if (lb && right_col)
+ breakable_column_spacing (me, lb, right_col, options);
+
+ if (left_col && rb)
+ breakable_column_spacing (me, left_col, rb, options);
+
+ if (lb && rb)
+ breakable_column_spacing (me, lb, rb, options);
+ }
+}
+
+void
+Spacing_spanner::generate_springs (Grob *me,
+ vector<Grob*> const &cols,
+ Spacing_options const *options)
+{
+ Paper_column *prev = 0;
+ for (vsize i = 0; i < cols.size (); i++)
+ {
+ Paper_column *col = dynamic_cast<Paper_column *> (cols[i]);
+ Paper_column *next = (i + 1 < cols.size ()) ? dynamic_cast<Paper_column *> (cols[i+1]) : 0;
+
+ if (i > 0)
+ generate_pair_spacing (me, prev, col, next, options);
+
+ prev = col;
+ }
+}
+
+/*
+ Generate the space between two musical columns LEFT_COL and RIGHT_COL, given
+ spacing parameters INCR and SHORTEST.
+*/
+void
+Spacing_spanner::musical_column_spacing (Grob *me,
+ Item *left_col,
+ Item *right_col,
+ Spacing_options const *options)
+{
+ bool expand_only = false;
+ Real base_note_space = note_spacing (me, left_col, right_col, options, &expand_only);
+
+ Real max_fixed = 0;
+ Real max_space = 0;
+ Real compound_note_space = 0.0;
+ Real compound_fixed_note_space = 0.0;
+
+ if (options->stretch_uniformly_)
+ {
+ compound_note_space = base_note_space;
+
+ if (!Paper_column::is_musical (right_col))
+ {
+ /*
+ Crude fix for notes that lead up to barlines and time sigs.