]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/break-substitution.cc
(LY_DEFINE): ly_kpathsea_expand_variable. New
[lilypond.git] / lily / break-substitution.cc
index 1c749d1bef219e7ed17f9680c5f543becff112c4..3ccc16c09063bbc80beeb2b0dd8059280673ed32 100644 (file)
@@ -19,7 +19,7 @@ set_break_subsititution (SCM criterion)
 SCM
 substitute_grob (Grob *sc)
 {
-  if (SCM_INUMP (break_criterion))
+  if (scm_is_integer (break_criterion))
     {
       Item * i = dynamic_cast<Item*> (sc);
       Direction d = to_dir (break_criterion);
@@ -91,7 +91,7 @@ do_break_substitution (SCM src)
  
   if (unsmob_grob (src))
     return substitute_grob (unsmob_grob (src));
-  else if (is_vector (src))
+  else if (ly_c_vector_p (src))
     {
       int len = SCM_VECTOR_LENGTH (src);
       SCM nv = scm_c_make_vector (len, SCM_UNDEFINED);
@@ -102,7 +102,7 @@ do_break_substitution (SCM src)
                            do_break_substitution (scm_vector_ref (src, si))); 
        }
     }
-  else if (ly_c_pair_p (src)) 
+  else if (scm_is_pair (src)) 
     {
       /*
        UGH! breaks on circular lists.
@@ -111,7 +111,7 @@ do_break_substitution (SCM src)
       SCM oldcdr = ly_cdr (src);
       
       if (newcar == SCM_UNDEFINED
-         && (ly_c_pair_p (oldcdr) || oldcdr == SCM_EOL))
+         && (scm_is_pair (oldcdr) || oldcdr == SCM_EOL))
        {
          /*
            This is tail-recursion, ie. 
@@ -142,7 +142,7 @@ substitute_grob_list (SCM grob_list)
   SCM l = SCM_EOL;
   SCM * tail = &l;
 
-  for (SCM s = grob_list; ly_c_pair_p (s); s =  ly_cdr (s))
+  for (SCM s = grob_list; scm_is_pair (s); s =  ly_cdr (s))
     {
       SCM n= substitute_grob (unsmob_grob (ly_car (s)));
 
@@ -350,7 +350,7 @@ Spanner::fast_fubstitute_grob_list (SCM sym,
   
   int sp_index = len;
   int it_index = 0;
-  for (SCM s = grob_list; ly_c_pair_p (s); s = ly_cdr (s))
+  for (SCM s = grob_list; scm_is_pair (s); s = ly_cdr (s))
     {
       Grob * g = unsmob_grob (ly_car (s));
 
@@ -467,7 +467,7 @@ substitute_mutable_property_alist (SCM alist)
 
   SCM l = SCM_EOL;
   SCM *tail = &l;
-  for (SCM s = alist; ly_c_pair_p (s); s = ly_cdr (s))
+  for (SCM s = alist; scm_is_pair (s); s = ly_cdr (s))
     {
       SCM sym = ly_caar (s);
       SCM val = ly_cdar (s);
@@ -478,10 +478,17 @@ substitute_mutable_property_alist (SCM alist)
       else
        val = do_break_substitution (val);
 
-      *tail = scm_cons (scm_cons (sym, val), SCM_EOL);
-      tail = SCM_CDRLOC (*tail);
-    }
 
+      if (val != SCM_UNDEFINED)
+       {
+         /*
+           for ly:grob? properties, SCM_UNDEFINED could leak out
+           through ly:grob-property
+          */
+         *tail = scm_cons (scm_cons (sym, val), SCM_EOL);
+         tail = SCM_CDRLOC (*tail);
+       }
+    }
   return l;
 }