]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4503 (4/4) Semi_tie cleanup
authorDan Eble <nine.fierce.ballads@gmail.com>
Mon, 13 Jul 2015 00:34:00 +0000 (20:34 -0400)
committerDan Eble <nine.fierce.ballads@gmail.com>
Tue, 21 Jul 2015 18:09:47 +0000 (14:09 -0400)
lily/include/semi-tie.hh
lily/semi-tie.cc

index d56caf7e32c578f31600c5a71c88b2d628a7ae82..97a3dcbe04cf3b98ba218c75b8a4e6e05cf5abb7 100644 (file)
@@ -32,8 +32,6 @@ struct Semi_tie
   static int get_column_rank (Item *);
   static int get_position (Item *);
   static Item *head (Item *);
-  // return the head if it is present on the given side
-  static Item *head (Item *, Direction d);
 };
 
 #endif /* SEMI_TIE_HH */
index 17520daf7010caca7ec34aefe3094a5959b655ea..049cd029d6c40d56eb9348e81b0639bf9f70cf12 100644 (file)
@@ -55,21 +55,22 @@ MAKE_SCHEME_CALLBACK (Semi_tie, calc_control_points, 1)
 SCM
 Semi_tie::calc_control_points (SCM smob)
 {
-  Grob *me = unsmob<Grob> (smob);
+  Item *me = LY_ASSERT_SMOB(Item, smob, 1);
+
   (void) me->get_property ("direction");
 
-  if (Semi_tie_column::has_interface (me->get_parent (Y_AXIS)))
-    {
-      me->get_parent (Y_AXIS)->get_property ("positioning-done");
-    }
-  else
+  Grob *yparent = me->get_parent (Y_AXIS);
+  if (Semi_tie_column::has_interface (yparent))
     {
-      programming_error ("lv tie without Semi_tie_column.  Killing lv tie.");
-      me->suicide ();
+      /* trigger positioning. */
+      yparent->get_property ("positioning-done");
+
+      return me->get_property_data ("control-points");
     }
 
-  // TODO: Even if me->suicide() was called?
-  return me->get_property_data ("control-points");
+  programming_error ("lv tie without Semi_tie_column.  Killing lv tie.");
+  me->suicide ();
+  return SCM_EOL;
 }
 
 int
@@ -102,10 +103,3 @@ Semi_tie::head (Item *me)
 {
   return unsmob<Item> (me->get_object ("note-head"));
 }
-
-Item *
-Semi_tie::head (Item *me, Direction d)
-{
-  SCM head_dir = me->get_property ("head-direction");
-  return (is_direction (head_dir) && (to_dir (head_dir) == d)) ? head (me) : 0;
-}