X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Faxis-group-engraver.cc;h=ffd0dd3a0ed170f5e5f67fad235fef8d1723dc94;hb=0568120713137e8d51f39f2a95f57c8e8cb5587d;hp=1bc232f4c5fc12dca618c12ba1e389eb53e465f9;hpb=e540311d3f5799216c91d203080f63b65cccde07;p=lilypond.git diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index 1bc232f4c5..ffd0dd3a0e 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -85,7 +85,6 @@ Axis_group_engraver::finalize () staffline_->set_bound (RIGHT,it); - typeset_grob (staffline_); staffline_ = 0; } @@ -102,23 +101,38 @@ Axis_group_engraver::acknowledge_grob (Grob_info i) void Axis_group_engraver::process_acknowledged_grobs () { - /* UGH UGH UGH */ + if (!staffline_) + return ; + for (int i=0; i < elts_.size (); i++) { Grob *par = elts_[i]->get_parent (Y_AXIS); if (!par || !Axis_group_interface::has_interface (par)) - if (elts_[i]->is_empty (Y_AXIS)) - { - /* - We have to do _something_, otherwise staff objects will - end up with System as parent. + { + if (staffline_->get_parent (Y_AXIS) + && staffline_->get_parent (Y_AXIS) == elts_[i]) + { + String msg = _("Axis_group_engraver: vertical group already has a parent.\n" + "Do you have two Axis_group_engravers?\n" + "Killing this vertical group."); + staffline_->warning (msg); + staffline_->suicide (); + staffline_ = 0; + break ; + } + else if (elts_[i]->is_empty (Y_AXIS)) + { + /* + We have to do _something_, otherwise staff objects will + end up with System as parent. - */ - elts_[i]->set_parent (staffline_, Y_AXIS); - } - else - add_element (elts_[i]); + */ + elts_[i]->set_parent (staffline_, Y_AXIS); + } + else + add_element (elts_[i]); + } } elts_.clear (); } @@ -170,8 +184,9 @@ void Hara_kiri_engraver::acknowledge_grob (Grob_info i) { Axis_group_engraver::acknowledge_grob (i); - if (i.grob_->internal_has_interface (ly_symbol2scm ("rhythmic-grob-interface")) - || i.grob_->internal_has_interface (ly_symbol2scm ("lyric-interface")) + if (staffline_ + && (i.grob_->internal_has_interface (ly_symbol2scm ("rhythmic-grob-interface")) + || i.grob_->internal_has_interface (ly_symbol2scm ("lyric-interface"))) ) { Hara_kiri_group_spanner::add_interesting_item (staffline_, i.grob_);