lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix 1336 (issue3594041)


From: Carl . D . Sorensen
Subject: Fix 1336 (issue3594041)
Date: Sat, 11 Dec 2010 17:40:20 +0000

Reviewers: ,

Message:
Here's a patch for issue 1336 that combine's Neil's idea of not creating
the paper columns with Graham's idea of erroring out when there are less
than 2 columns.

Thanks,

Carl


Description:
Fix 1336

Please review this at http://codereview.appspot.com/3594041/

Affected files:
  M lily/paper-column-engraver.cc
  M lily/simple-spacer.cc


Index: lily/paper-column-engraver.cc
diff --git a/lily/paper-column-engraver.cc b/lily/paper-column-engraver.cc
index 33690e38a80d1afba55b5ed99abe24e3d5ce9ba1..764937c30a10cb4711389d4c984ad9eb82a2f67d 100644
--- a/lily/paper-column-engraver.cc
+++ b/lily/paper-column-engraver.cc
@@ -199,6 +199,8 @@ Paper_column_engraver::process_music ()
 void
 Paper_column_engraver::stop_translation_timestep ()
 {
+  if (to_boolean (get_property ("skipTypesetting")))
+    return;
   SCM m = now_mom ().smobbed_copy ();
   command_column_->set_property ("when", m);
   musical_column_->set_property ("when", m);
@@ -267,7 +269,7 @@ Paper_column_engraver::start_translation_timestep ()
   /*
     TODO: don't make columns when skipTypesetting is true.
   */
-  if (!first_)
+  if (!first_ && !to_boolean (get_property ("skipTypesetting")))
     make_columns ();
 }

Index: lily/simple-spacer.cc
diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc
index 9cdf664797db8c803369129ab7d3530aa75d389e..f9d9cd22c24a06770fa3f7e9206cf3bb87240751 100644
--- a/lily/simple-spacer.cc
+++ b/lily/simple-spacer.cc
@@ -245,7 +245,7 @@ Simple_spacer::compress_line ()
          assert (fabs (configuration_length (cur_force) - cur_len) < 1e-6);
          return cur_force;
        }
-
+
       cur_len -= block_dist;
inv_hooke -= compressed ? sp.inverse_compress_strength () : sp.inverse_stretch_strength ();
       cur_force = sp.blocking_force ();
@@ -381,7 +381,7 @@ get_column_description (vector<Grob*> const &cols, vsize col_index, bool line_st description.end_rods_.push_back (Rod_description (j, scm_to_double (scm_cdar (s))));
        }
     }
-
+
   if (!line_starter && to_boolean (col->get_property ("keep-inside-line")))
     description.keep_inside_line_ = col->extent (col, X_AXIS);

@@ -393,6 +393,8 @@ vector<Real>
 get_line_forces (vector<Grob*> const &columns,
                 Real line_len, Real indent, bool ragged)
 {
+  if (columns.size () < 2)
+      error (_ ("no music remaining to typeset"));
   vector<vsize> breaks;
   vector<Real> force;
   vector<Grob*> non_loose;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]