]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob.cc
release: 1.5.17
[lilypond.git] / lily / grob.cc
index 314db7ae4e69798277b6d089036d03ddee2b9bd4..f55ee2f8e257b73fe4ac3b41ae317a9a0a8e4f4e 100644 (file)
@@ -92,12 +92,14 @@ Grob::Grob (SCM basicprops)
     }
 
   SCM meta = get_grob_property ("meta");
-  SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
+  if (gh_pair_p (meta))
+    {
+      SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
   
-  set_grob_property ("interfaces",ly_cdr (ifs));
+      set_grob_property ("interfaces",ly_cdr (ifs));
+    }
 }
 
-
 Grob::Grob (Grob const&s)
    : dim_cache_ (s.dim_cache_)
 {
@@ -139,7 +141,7 @@ Grob::get_grob_property (SCM sym) const
 
 /*
   Remove the value associated with KEY, and return it. The result is
-  that a next call will yield SCM_UNDEFINED (and not the underlying
+  that a next call will yield SCM_EOL (and not the underlying
   `basic' property.
 */
 SCM
@@ -278,7 +280,7 @@ Grob::get_uncached_molecule ()const
 
   SCM  mol = SCM_EOL;
   if (gh_procedure_p (proc)) 
-    mol = gh_apply (proc, scm_listify (this->self_scm (), SCM_UNDEFINED));
+    mol = gh_apply (proc, scm_list_n (this->self_scm (), SCM_UNDEFINED));
 
   
   Molecule *m = unsmob_molecule (mol);
@@ -296,7 +298,7 @@ Grob::get_uncached_molecule ()const
       // ugr.
       
       mol = Molecule (m->extent_box (),
-                     scm_listify (origin, m->get_expr (), SCM_UNDEFINED)
+                     scm_list_n (origin, m->get_expr (), SCM_UNDEFINED)
                      ). smobbed_copy ();
 
       m = unsmob_molecule (mol);
@@ -387,6 +389,12 @@ Grob::handle_broken_grobs (SCM src, SCM criterion)
 
          /* now: sc && sc->line_l () == line */
          if (!line
+             /*
+               This was introduced in 1.3.49 as a measure to prevent
+               programming errors. It looks expensive (?). TODO:
+               benchmark , document when (what kind of programming
+               errors) this happens.
+              */
              || (sc->common_refpoint (line, X_AXIS)
                  && sc->common_refpoint (line, Y_AXIS)))
            {
@@ -672,7 +680,7 @@ Grob::name () const
   SCM meta = get_grob_property ("meta");
   SCM nm = scm_assoc (ly_symbol2scm ("name"), meta);
   nm = (gh_pair_p (nm)) ? ly_cdr (nm) : SCM_EOL;
-  return  gh_string_p (nm) ?ly_scm2string (nm) :  classname (this);  
+  return  gh_symbol_p (nm) ? ly_symbol2string (nm) :  classname (this);  
 }
 
 void
@@ -760,7 +768,7 @@ Grob::fixup_refpoint (SCM smob)
  ****************************************************/
 
 
-IMPLEMENT_UNSMOB (Grob, grob);
+
 IMPLEMENT_SMOBS (Grob);
 IMPLEMENT_DEFAULT_EQUAL_P (Grob);