]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.27.hwn1
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 25 Feb 2000 10:13:59 +0000 (11:13 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 25 Feb 2000 10:13:59 +0000 (11:13 +0100)
VERSION
lily/paper-score.cc
lily/score-element.cc

diff --git a/VERSION b/VERSION
index 4e6268cb091ee66d1c67a5db17cdaceaaf061ba1..f62de114bd78003a8b4abce4580bb83f8d40da3c 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=27
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=hwn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 0b487a077b78a6d7af26b57fcaf40c453182cf38..bb8cd0d4742f1823e8dc9501e9f86048127d9553 100644 (file)
@@ -133,7 +133,7 @@ Paper_score::process ()
       Score_element *sc = unsmob_element (gh_car (s));
       sc->handle_broken_dependencies ();
     }
-
+  
   outputter_l_ = new Paper_outputter ;
   outputter_l_->output_header ();
 
index cfa1bfd569d5dae824d8287882ca46f9af6ccfee..39d1d26c700d4914b4cacf52da07f9e9f630505e 100644 (file)
@@ -54,19 +54,6 @@ Score_element::Score_element()
   set_elt_property ("interfaces", SCM_EOL);
 }
 
-SCM ly_deep_copy (SCM);
-
-SCM
-ly_deep_copy (SCM l)
-{
-  if (gh_pair_p (l))
-    {
-      return gh_cons (ly_deep_copy (gh_car (l)), ly_deep_copy (gh_cdr (l)));
-    }
-  else
-    return l;
-}
-
 
 Score_element::Score_element (Score_element const&s)
 {
@@ -77,12 +64,7 @@ Score_element::Score_element (Score_element const&s)
   self_scm_ = SCM_EOL;
   used_b_ = true;
   original_l_ =(Score_element*) &s;
-
-  /*
-    should protect because smobify_self () might trigger GC.
-   */
-  SCM onstack = ly_deep_copy (s.element_property_alist_);
-  element_property_alist_ = onstack;
+  element_property_alist_ = SCM_EOL; // onstack;
 
   output_p_ =0;
   status_i_ = s.status_i_;
@@ -377,15 +359,16 @@ Score_element::add_dependency (Score_element*e)
 
 /**
       Do break substitution in S, using CRITERION. Return new value.
-         CRITERION is either a SMOB pointer to the desired line, or a number
-        representing the break direction.  */
+      CRITERION is either a SMOB pointer to the desired line, or a number
+      representing the break direction. Do not modify SRC.
+*/
 SCM
-Score_element::handle_broken_smobs (SCM s, SCM criterion)
+Score_element::handle_broken_smobs (SCM src, SCM criterion)
 {
  again:
 
   
-  Score_element *sc = unsmob_element ( s);
+  Score_element *sc = unsmob_element (src);
   if (sc)
     {
       if (criterion == SCM_UNDEFINED)
@@ -415,13 +398,13 @@ Score_element::handle_broken_smobs (SCM s, SCM criterion)
            return SCM_UNDEFINED;
        }
     }
-  else if (gh_pair_p (s))
+  else if (gh_pair_p (src))
     {
       /*
        UGH! breaks on circular lists.
       */
-      SCM car = handle_broken_smobs (gh_car (s), criterion);
-      SCM cdr = gh_cdr (s);
+      SCM car = handle_broken_smobs (gh_car (src), criterion);
+      SCM cdr = gh_cdr (src);
       
       if (car == SCM_UNDEFINED
          && (gh_pair_p (cdr) || cdr == SCM_EOL))
@@ -432,26 +415,42 @@ Score_element::handle_broken_smobs (SCM s, SCM criterion)
            return handle_broken_smobs (cdr, criterion);
 
            We don't want to rely on the compiler to do this.  */
-         s =  cdr;     
+         src =  cdr;   
          goto again;
        }
 
-      gh_set_car_x (s, car);
-      gh_set_cdr_x (s, handle_broken_smobs (cdr, criterion));
-      return s;
+      return gh_cons (car, handle_broken_smobs (cdr, criterion));
     }
-  return s;
+  else
+    return src;
+
+  return src;
 }
 
 void
 Score_element::handle_broken_dependencies()
 {
-  Line_of_score *line  = line_l();
-  element_property_alist_ = handle_broken_smobs (element_property_alist_,
-                                                line ? line->self_scm_ : SCM_UNDEFINED);
-
-  if (!line)
+  Spanner * s= dynamic_cast<Spanner*> (this);
+  if (original_l_ && s)
     return;
+
+
+  if (s)
+    {
+      for (int i = 0;  i< s->broken_into_l_arr_ .size (); i++)
+       {
+         Score_element * sc = s->broken_into_l_arr_[i];
+         Line_of_score * l = sc->line_l ();
+         s->broken_into_l_arr_[i]->element_property_alist_ =
+           handle_broken_smobs (element_property_alist_,
+                                l ? l->self_scm_ : SCM_UNDEFINED);
+       }
+    }
+
+  Line_of_score *line = line_l();
+  element_property_alist_
+    = handle_broken_smobs (element_property_alist_,
+                          line ? line->self_scm_ : SCM_UNDEFINED);
 }
 
 
@@ -463,16 +462,15 @@ Score_element::handle_prebroken_dependencies()
 {
   if (Item*i =dynamic_cast<Item*> (this))
     {
-      element_property_alist_
-       = handle_broken_smobs (element_property_alist_,
+      if (original_l_)
+       {
+         element_property_alist_
+           = handle_broken_smobs (original_l_->element_property_alist_,
                               gh_int2scm (i->break_status_dir ()));
+       }
     }
 }
 
-
-
-
-
 Link_array<Score_element>
 Score_element::get_extra_dependencies() const
 {
@@ -497,8 +495,6 @@ Score_element::find_broken_piece (Line_of_score*) const
   return 0;
 }
 
-
-
 void
 Score_element::translate_axis (Real y, Axis a)
 {
@@ -636,8 +632,9 @@ Score_element::print_smob (SCM s, SCM port, scm_print_state *)
   scm_puts ("#<Score_element ", port);
   scm_puts ((char *)sc->name (), port);
 
-  // scm_puts (" properties = ", port);
-  // scm_display (sc->element_property_alist_, port);
+  /*
+    don't try to print properties, that is too much hassle.
+   */
   scm_puts (" >", port);
   return 1;
 }