]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4094: Check for Note_column interface before using grob.
authorDan Eble <eble@ticalc.org>
Sat, 6 Sep 2014 18:35:20 +0000 (14:35 -0400)
committerJames Lowe <pkx166h@gmail.com>
Wed, 17 Sep 2014 15:17:43 +0000 (16:17 +0100)
Rest_collision was calling Note_column functions on grobs that did not
have the Note_column interface.  Now Rest_collision ignores such grobs
and Note_column will print a more accurate message if such an error
ever happens again.

lily/note-column.cc
lily/rest-collision.cc

index 73b138757189d839ea510d86ef8d0a88ac116804..dcca364e172b4887e06250670c25afa6ef12a14b 100644 (file)
@@ -107,7 +107,10 @@ Note_column::dir (Grob *me)
         return (Direction)sign (head_positions_interval (me).center ());
     }
 
-  programming_error ("note column without heads and stem");
+  if (has_interface (me))
+    programming_error ("Note_column without heads and stem");
+  else
+    programming_error ("dir() given grob without Note_column interface");
   return CENTER;
 }
 
index ac79df4fbd1b758e809bbee75fea081f196ae2a6..d82358661fef39edc409175a9adb176312ae6209 100644 (file)
@@ -108,10 +108,13 @@ Rest_collision::calc_positioning_done (SCM smob)
   for (vsize i = 0; i < elts.size (); i++)
     {
       Grob *e = elts[i];
-      if (Grob::unsmob (e->get_object ("rest")))
-        rests.push_back (e);
-      else
-        notes.push_back (e);
+      if (Note_column::has_interface (e))
+        {
+          if (Grob::unsmob (e->get_object ("rest")))
+            rests.push_back (e);
+          else
+            notes.push_back (e);
+        }
     }
 
   /*