- /*
- sloppy with typing left/right-neighbors should take list, but paper-column found instead.
- */
- extract_grob_set (cols[i], "left-neighbors", lns);
- if (lns.empty () && i)
- {
- SCM ga_scm = Grob_array::make_array ();
- Grob_array *ga = unsmob_grob_array (ga_scm);
- ga->add (cols[i - 1]);
- cols[i]->set_object ("left-neighbors", ga_scm);
- }
- extract_grob_set (cols[i], "right-neighbors", rns);
- if (rns.empty () && i < cols.size () - 1)
- {
- SCM ga_scm = Grob_array::make_array ();
- Grob_array *ga = unsmob_grob_array (ga_scm);
- ga->add (cols[i + 1]);
- cols[i]->set_object ("right-neighbors", ga_scm);
- }
+ if (i && !unsmob_grob (cols[i]->get_object ("left-neighbor")))
+ cols[i]->set_object ("left-neighbor", cols[i-1]->self_scm ());
+ if (i + 1 < cols.size () && !unsmob_grob (cols[i]->get_object ("right-neighbor")))
+ cols[i]->set_object ("right-neighbor", cols[i+1]->self_scm ());