]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spanner.cc
(overdone_heads): typos.
[lilypond.git] / lily / spanner.cc
index 69ed46231cda14c17bdaea4c96df82a980ff11f7..69251e2a2ab3166d6e84b732061f37ce248cb53b 100644 (file)
@@ -5,12 +5,14 @@
 
   (c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
-#include <math.h>
-#include <libc-extension.hh>
 
+#include "spanner.hh"
+
+#include <cmath>
+
+#include <libc-extension.hh>
 
 #include "warn.hh"
-#include "spanner.hh"
 #include "paper-column.hh"
 #include "paper-score.hh"
 #include "stencil.hh"
 #include "system.hh"
 #include "group-interface.hh"
 
+
+
+Grob * 
+Spanner::clone (int count) const
+{
+  return new Spanner (*this, count);
+}
+
 void
 Spanner::do_break_processing ()
 {
@@ -62,7 +72,7 @@ Spanner::do_break_processing ()
            programming_error ("no broken bound");
          else if (bound->get_system ())
            {
-             Spanner * span = dynamic_cast<Spanner*> (clone ());
+             Spanner * span = dynamic_cast<Spanner*> (clone (broken_intos_.size ()));
              span->set_bound (LEFT, bound);
              span->set_bound (RIGHT, bound);
 
@@ -99,7 +109,7 @@ Spanner::do_break_processing ()
              continue; 
            }
 
-         Spanner *span = dynamic_cast<Spanner*> (clone ());
+         Spanner *span = dynamic_cast<Spanner*> (clone (broken_intos_.size ()));
          span->set_bound (LEFT,bounds[LEFT]);
          span->set_bound (RIGHT,bounds[RIGHT]);
 
@@ -124,7 +134,7 @@ Spanner::do_break_processing ()
 }
 
 int
-Spanner::get_break_index ()const
+Spanner::get_break_index () const
 {
   return break_index_;
 }
@@ -146,14 +156,10 @@ Spanner::spanned_rank_iv ()
 {
   Interval_t<int> iv (0, 0);
 
-  if (spanned_drul_[LEFT])
-    {
-      iv[LEFT] = Paper_column::get_rank (spanned_drul_[LEFT]->get_column ());
-    }
-  if (spanned_drul_[RIGHT])
-    {
-      iv[RIGHT] = Paper_column::get_rank (spanned_drul_[RIGHT]->get_column ());
-    }
+  if (spanned_drul_[LEFT] && spanned_drul_[LEFT]->get_column ())
+    iv[LEFT] = Paper_column::get_rank (spanned_drul_[LEFT]->get_column ());
+  if (spanned_drul_[RIGHT] && spanned_drul_[RIGHT]->get_column ())
+    iv[RIGHT] = Paper_column::get_rank (spanned_drul_[RIGHT]->get_column ());
   return iv;
 }
 
@@ -202,8 +208,8 @@ Spanner::set_bound (Direction d, Grob*s)
     }
 }
 
-Spanner::Spanner (SCM s)
-  : Grob (s)
+Spanner::Spanner (SCM s, Object_key const*key)
+  : Grob (s, key)
 {
   break_index_ = 0;
   spanned_drul_[LEFT]=0;
@@ -212,8 +218,8 @@ Spanner::Spanner (SCM s)
   Group_interface::add_thing (this, ly_symbol2scm ("interfaces"), ly_symbol2scm ("spanner-interface"));
 }
 
-Spanner::Spanner (Spanner const &s)
-  : Grob (s)
+Spanner::Spanner (Spanner const &s, int count)
+  : Grob (s, count)
 {
   spanned_drul_[LEFT] = spanned_drul_[RIGHT] =0;
 }