]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/simple-spacer.cc
Remove unused include in break-alignment-interface (issue 3262)
[lilypond.git] / lily / simple-spacer.cc
index 4644ad7c4b952a98b7d17c567b7eae321ef09c45..61afdb9bcc281004c4b0dbffbabe2fbd757ec4d5 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1999--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1999--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   TODO:
   - add support for different stretch/shrink constants?
@@ -160,6 +160,12 @@ Simple_spacer::configuration_length (Real force) const
   return l;
 }
 
+void
+Simple_spacer::set_force (Real force)
+{
+  force_ = force;
+}
+
 void
 Simple_spacer::solve (Real line_len, bool ragged)
 {
@@ -364,9 +370,12 @@ get_column_description (vector<Grob *> const &cols, vsize col_index, bool line_s
   if (next_col)
     description.spring_ = Spaceable_grob::get_spring (col, next_col);
 
-  Grob *end_col = dynamic_cast<Item *> (cols[col_index + 1])->find_prebroken_piece (LEFT);
-  if (end_col)
-    description.end_spring_ = Spaceable_grob::get_spring (col, end_col);
+  if (col_index + 1 < cols.size ())
+    {
+      Grob *end_col = dynamic_cast<Item *> (cols[col_index + 1])->find_prebroken_piece (LEFT);
+      if (end_col)
+        description.end_spring_ = Spaceable_grob::get_spring (col, end_col);
+    }
 
   for (SCM s = Spaceable_grob::get_minimum_distances (col);
        scm_is_pair (s); s = scm_cdr (s))
@@ -523,7 +532,6 @@ get_line_configuration (vector<Grob *> const &columns,
   return ret;
 }
 
-
 #include "ly-smobs.icc"
 
 IMPLEMENT_SIMPLE_SMOBS (Simple_spacer);