]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/score-priority-grav.cc
release: 0.1.54
[lilypond.git] / lily / score-priority-grav.cc
index 1358ec42320cd6a7ec747c44f5564605c78fb685..9e2e2cc918fff32a7df260d476a23b4744e6d55e 100644 (file)
@@ -36,42 +36,40 @@ void
 Score_priority_engraver::acknowledge_element (Score_elem_info inf)
 {
   Item * item_l = inf.elem_l_->item ();
-  if (item_l && item_l->breakable_b_)
+  if (item_l && item_l->breakable_b_ && !item_l->empty_b ())
     {
       /*
        Don't try to eat up our (probable) parent.
-       */
+      */
       if (inf.origin_grav_l_arr_.size () <= 1 &&
          item_l->is_type_b (Break_align_item::static_name ()))
        return; 
 
       
-      int p =item_l-> break_priority_i_;
+      int priority =item_l->break_priority_i_;
       Horizontal_group_item * hg =0;
-      if (!align_p_assoc_.elt_b(p))
-         {
-           hg = new Horizontal_group_item;
-           announce_element (Score_elem_info (hg,0));
-           align_p_assoc_[p] = hg;
-           hg->break_priority_i_ = p;
-           hg->breakable_b_ = true;
-         }
+      if (!align_p_assoc_.elt_b(priority))
+       {
+         hg = new Horizontal_group_item;
+         announce_element (Score_elem_info (hg,0));
+         align_p_assoc_[priority] = hg;
+         hg->break_priority_i_ = priority;
+         hg->breakable_b_ = true;
+       }
       else
-       hg = align_p_assoc_[p];
+       hg = align_p_assoc_[priority];
       
       Score_elem * unbound_elem = inf.elem_l_;
 
-      
       while (unbound_elem->axis_group_l_a_[X_AXIS])
        {
          /* We might have added inf.elem_l_ earlier because we added one
             of its children.  We don't want to add ourselves to ourself
-            */
+         */
          if (unbound_elem->axis_group_l_a_[X_AXIS] == hg)
            return;
          unbound_elem = unbound_elem->axis_group_l_a_[X_AXIS];
        }
-       
 
       hg->add_element (unbound_elem);
     }