]> git.donarmstrong.com Git - lilypond.git/commitdiff
check for calculation-in-progress marker in get_property().
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 26 Jan 2007 00:34:03 +0000 (01:34 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 26 Jan 2007 00:34:03 +0000 (01:34 +0100)
lily/accidental-placement.cc
lily/align-interface.cc
lily/break-alignment-interface.cc
lily/dot-column.cc
lily/grob-property.cc
lily/grob.cc
lily/note-collision.cc
lily/rest-collision.cc
lily/semi-tie-column.cc
lily/stem.cc
lily/tie-column.cc

index cbc1478608fba2bc42ddf31c34ae5a5b59157da4..15049f5bc0d076c568cc395608bd46a808407bb4 100644 (file)
@@ -251,6 +251,8 @@ Accidental_placement::calc_positioning_done (SCM smob)
   if (!me->is_live ())
     return SCM_BOOL_T;
 
+  me->set_property ("positioning-done", SCM_BOOL_T);
+  
   SCM accs = me->get_object ("accidental-grobs");
   if (!scm_is_pair (accs))
     return SCM_BOOL_T;
index fc62e45eb3eba2b28ee5dbbfbb475897b5d40309..09887a7c9fd893581d403f539f87fabc495e3570 100644 (file)
@@ -30,6 +30,9 @@ SCM
 Align_interface::calc_positioning_done (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
+
+  me->set_property ("positioning-done", SCM_BOOL_T);
+
   SCM axis = scm_car (me->get_property ("axes"));
   Axis ax = Axis (scm_to_int (axis));
 
index 61eca90ab6b3611ef98d0a0c63fa5bf752519241..c2c335434962a6e7b32d268580c276d7701bc5ea 100644 (file)
@@ -93,6 +93,9 @@ Break_alignment_interface::calc_positioning_done (SCM smob)
   Grob *grob = unsmob_grob (smob);  
   Item *me = dynamic_cast<Item *> (grob);
 
+
+  me->set_property ("positioning-done", SCM_BOOL_T);
+
   vector<Grob*> elems = ordered_elements (me);
   vector<Interval> extents;
 
index 173a9ad981f3add800a0295f074f56a343b9bfc4..b2ff0308fac19b82bd251167a4255d2698e9bcb0 100644 (file)
@@ -213,6 +213,9 @@ SCM
 Dot_column::calc_positioning_done (SCM smob)
 {
   Grob *me = unsmob_grob (smob);  
+
+  me->set_property ("positioning-done", SCM_BOOL_T);
+
   vector<Grob*> dots
     = extract_grob_array (me, "dots");
 
index b62a6bb9f9f94f815221f2c1f7819d0276e24ec0..0a4e1a669f6686f414e53f304ee4fbac2a83b0d6 100644 (file)
@@ -149,6 +149,14 @@ SCM
 Grob::internal_get_property (SCM sym) const
 {
   SCM val = get_property_data (sym);
+
+#ifndef NDEBUG
+  if (val == ly_symbol2scm ("calculation-in-progress"))
+    programming_error (_f ("cyclic dependency: calculation-in-progress encountered for #'%s (%s)",
+                          ly_symbol2string (sym).c_str (),
+                          name().c_str ()));
+#endif
+  
   if (ly_is_procedure (val)
       || is_simple_closure (val))
     {
@@ -203,7 +211,7 @@ Grob::try_callback_on_alist (SCM *alist, SCM sym, SCM proc)
   */
   if (value == SCM_UNSPECIFIED)
     {
-      value = internal_get_property (sym);
+      value = get_property_data (sym);
       assert (value == SCM_EOL || value == marker);
       if (value == marker)
        *alist = scm_assq_remove_x (*alist, marker);
index 1941d7d2f87d6ed2eebfa8039dd3585ed84b1f6d..e12152821b075a4a194f1f3b3e8facb80eb227be 100644 (file)
@@ -394,7 +394,7 @@ Grob::extent (Grob *refp, Axis a) const
        (a == X_AXIS)
        ? ly_symbol2scm ("X-extent")
        : ly_symbol2scm ("Y-extent");
-
+       
       SCM ext = internal_get_property (ext_sym);
       if (is_number_pair (ext))
        real_ext.unite (ly_scm2interval (ext));
index 7d92a76ec0600f33756094e3086ee711b8bcb453..488d77f1b72b4cffc07969dc20c53172eb1068ee 100644 (file)
@@ -323,7 +323,9 @@ MAKE_SCHEME_CALLBACK(Note_collision_interface, calc_positioning_done, 1)
 SCM
 Note_collision_interface::calc_positioning_done (SCM smob)
 {
-  Grob *me = unsmob_grob (smob);  
+  Grob *me = unsmob_grob (smob);
+  me->set_property ("positioning-done", SCM_BOOL_T);
+  
   Drul_array<vector<Grob*> > cg = get_clash_groups (me);
 
   Direction d = UP;
index b8ad86ba916a9c5e31633da5d44a7548a4bcdb51..8ba0d49c7bc43db14cab429444cde325e9076c9c 100644 (file)
@@ -92,6 +92,9 @@ SCM
 Rest_collision::calc_positioning_done (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
+
+  me->set_property ("positioning-done", SCM_BOOL_T);
+
   extract_grob_set (me, "elements", elts);
 
   vector<Grob*> rests;
index c7d44a9568fa506c12196ba8f1285a97f45c137f..ee18953aef22247e8472eae4319ee81b20069cba 100644 (file)
@@ -39,7 +39,9 @@ SCM
 Semi_tie_column::calc_positioning_done (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  
+
+  me->set_property ("positioning-done", SCM_BOOL_T);
+    
   extract_grob_set (me, "ties", lv_ro_ties);
   vector<Grob*> lv_ties (lv_ro_ties);
 
index 7c369e4bb060c281d4aeaeb797eaf097c08e02bc..dc7c82e91b63d6c191db0ea9545f5666753fdd23 100644 (file)
@@ -410,6 +410,8 @@ Stem::calc_positioning_done (SCM smob)
   if (!head_count (me))
     return SCM_BOOL_T;
 
+  me->set_property ("positioning-done", SCM_BOOL_T);
+  
   extract_grob_set (me, "note-heads", ro_heads);
   vector<Grob*> heads (ro_heads);
   vector_sort (heads, position_less);
index 9eefbbf8ee10252c5b3360152280c9e759703392..b54428d986fca49ac7a1b2492cefd227c762c8f6 100644 (file)
@@ -79,6 +79,9 @@ Tie_column::calc_positioning_done (SCM smob)
   if (!ties.size ())
     return SCM_BOOL_T;
 
+
+  me->set_property ("positioning-done", SCM_BOOL_T);
+
   vector_sort (ties, Tie::less);
 
   Tie_formatting_problem problem;