]> git.donarmstrong.com Git - lilypond.git/commitdiff
(process_acknowledged_grobs): catch
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 4 Jul 2004 12:33:05 +0000 (12:33 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 4 Jul 2004 12:33:05 +0000 (12:33 +0000)
cyclic parents when two axis-group-engravers are present.

ChangeLog
lily/axis-group-engraver.cc

index a9fa5fee63787218055d3e18d54c465ae09af5af..8c3fd6af0088116a1fb3df23c56db0acd2fdf13b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2004-07-04  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/axis-group-engraver.cc (process_acknowledged_grobs): catch
+       cyclic parents when two axis-group-engravers are
+       present. Backportme?
+
+       * input/test/volta-chord-names.ly: new file.
+
        * scm/define-context-properties.scm
        (all-user-translation-properties): change voltaOnThisStaff
        definition. Backport? 
index f62de7f1de250d70fa021b9b704b31fd7cbfb789..ffd0dd3a0ed170f5e5f67fad235fef8d1723dc94 100644 (file)
@@ -101,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 ();
 }
@@ -169,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_);