]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/item.cc
release: 0.1.9
[lilypond.git] / lily / item.cc
index b47ac190e9fb698e6150051d69a3114a73c1fd2a..6c4a7699c814da15146eba6ce18e0a8f8c9a0a00 100644 (file)
 
 Item::Item()
 {
-    breakable_b_ = false;
-    break_status_i_ = 0;
-    pcol_l_ = 0;
-    broken_to_a_[0] = broken_to_a_[1]=0;
+  breakable_b_ = false;
+  break_status_i_ = 0;
+  pcol_l_ = 0;
+  broken_to_a_[0] = broken_to_a_[1]=0;
 }
 
 IMPLEMENT_IS_TYPE_B1(Item, Score_elem);
@@ -26,7 +26,7 @@ void
 Item::do_print() const
 {
 #ifndef NPRINT
-    DOUT << "(unknown)";
+  DOUT << "(unknown)";
 #endif
 }
 
@@ -34,28 +34,29 @@ Item::do_print() const
 Real 
 Item::hpos_f()const
 {
-    return pcol_l_->hpos_f_ + absolute_coordinate (X_AXIS);
+  return pcol_l_->hpos_f_ + absolute_coordinate (X_AXIS);
 }
 
 Line_of_score *
 Item::line_l()const
 {
-    return pcol_l_->line_l_;
+  return pcol_l_->line_l_;
 }
 
 int
 Item::break_status_i() const
 {
-    return break_status_i_;
+  return break_status_i_;
 }
 
 void
 Item::copy_breakable_items()
 {
-    if ( broken_to_a_[0] || broken_to_a_[1])
+  if ( broken_to_a_[0] || broken_to_a_[1])
        return;
-    Item *new_copies[2];
-    for (int i=0; i < 2; i++) {
+  Item *new_copies[2];
+  for (int i=0; i < 2; i++) 
+    {
        Item * item_p = clone()->item ();
        item_p->copy_dependencies (*this);
        
@@ -64,56 +65,56 @@ Item::copy_breakable_items()
        item_p->handle_prebroken_dependencies();
        new_copies[i] =item_p;
     }
-    broken_to_a_= new_copies;
+  broken_to_a_= new_copies;
 }
 
 void
 Item::do_breakable_col_processing()
 {
-    if (!breakable_b_ || !pcol_l_->breakable_b())
+  if (!breakable_b_ || !pcol_l_->breakable_b())
        return;
 
-    copy_breakable_items();
-    handle_prebroken_dependencies();
+  copy_breakable_items();
+  handle_prebroken_dependencies();
 
-    /*
-      Otherwise the broken items won't be pre_process()'ed.
-     */
-    add_dependency (broken_to_a_[0]);
-    add_dependency (broken_to_a_[1]);    
+  /*
+    Otherwise the broken items won't be pre_process()'ed.
+   */
+  add_dependency (broken_to_a_[0]);
+  add_dependency (broken_to_a_[1]);    
 
 }
 
 Item*
 Item::find_prebroken_piece (Line_of_score*l) const
 {
-    if (line_l() == l) 
+  if (line_l() == l) 
        return (Item*)this;
-    else if (broken_to_a_[0] && broken_to_a_[0]->line_l() == l)
+  else if (broken_to_a_[0] && broken_to_a_[0]->line_l() == l)
        return broken_to_a_[0];
-    else if (broken_to_a_[1] && broken_to_a_[1]->line_l() == l)
+  else if (broken_to_a_[1] && broken_to_a_[1]->line_l() == l)
        return broken_to_a_[1];
 
-    return 0;
+  return 0;
 }
 
 Item*
 Item::find_prebroken_piece (PCol*c)const
 {
-    if (c == pcol_l_)
+  if (c == pcol_l_)
        return (Item *) this;   // ugh
 
-    if (c == pcol_l_->prebreak_p_)
+  if (c == pcol_l_->prebreak_p_)
        return (Item *) broken_to_a_[0];
-    else if (c==pcol_l_->postbreak_p_)
+  else if (c==pcol_l_->postbreak_p_)
        return  (Item *)broken_to_a_[1];
 
-    assert (false);
+  assert (false);
 }
 
 void
 Item::handle_prebroken_dependencies()
 {
-    if ( breakable_b_)
+  if ( breakable_b_)
        Score_elem::handle_prebroken_dependencies();
 }