X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fitem.cc;h=a47b19eafd0f16981a693d7a9c266cba17e707c7;hb=55a36d7beef61098884e49d6b853ce3d7a79811a;hp=c5cca666d565605b205a2bf719876a3d60cb551e;hpb=1e1fa5221ca359326b073626168c6b7cda6453e1;p=lilypond.git diff --git a/lily/item.cc b/lily/item.cc index c5cca666d5..a47b19eafd 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -6,29 +6,36 @@ (c) 1997--2004 Han-Wen Nienhuys */ +#include "item.hh" + #include "paper-score.hh" #include "warn.hh" -#include "item.hh" #include "paper-column.hh" -#include "spanner.hh" #include "lily-guile.hh" #include "system.hh" #include "group-interface.hh" -Item::Item (SCM s) - : Grob (s) +Grob * +Item::clone (int count) const +{ + return new Item (*this, count); +} + + +Item::Item (SCM s, Object_key const *key) + : Grob (s, key) { - broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]=0; + broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]= 0; Group_interface::add_thing (this, ly_symbol2scm ("interfaces"), ly_symbol2scm ("item-interface")); } /** Item copy ctor. Copy nothing: everything should be a elt property or a special purpose pointer (such as broken_to_drul_[]) */ -Item::Item (Item const &s) - : Grob (s) +Item::Item (Item const &s, int copy_count) + : Grob (s, copy_count) { - broken_to_drul_[LEFT] = broken_to_drul_[RIGHT] =0; + broken_to_drul_[LEFT] = broken_to_drul_[RIGHT] = 0; } @@ -64,16 +71,17 @@ void Item::copy_breakable_items () { Drul_array new_copies; - Direction i=LEFT; + Direction i = LEFT; + int count = 0; do { - Grob * dolly = clone (); + Grob * dolly = clone (count ++); Item * item = dynamic_cast (dolly); pscore_->system_->typeset_grob (item); - new_copies[i] =item; + new_copies[i] = item; } while (flip (&i) != LEFT); - broken_to_drul_= new_copies; + broken_to_drul_ = new_copies; }