]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/staff-side.cc
release: 1.3.10
[lilypond.git] / lily / staff-side.cc
index 20440aa923eb27197df2a5b0467ab9d01314bfc7..068ff7b2c2d0c6ef0adcf6b83412849ac2749384 100644 (file)
@@ -45,10 +45,9 @@ Side_position_interface::get_direction () const
     }
   
   SCM other_elt = elt_l_->get_elt_property ("direction-source");
-  if (SMOB_IS_TYPE_B (Score_element, other_elt))
+  Score_element * e = unsmob_element(other_elt);
+  if (e)
     {
-      Score_element * e = SMOB_TO_TYPE(Score_element,other_elt);
-
       return relative_dir * Side_position_interface (e).get_direction ();
     }
   
@@ -69,25 +68,23 @@ Side_position_interface::side_position (Dimension_cache const * c)
   SCM support = me->get_elt_property ("side-support");
   for (SCM s = support; s != SCM_EOL; s = gh_cdr (s))
     {
-      if (!SMOB_IS_TYPE_B (Score_element, gh_car (s)))
-       continue;
-      
-      Score_element * e  = SMOB_TO_TYPE(Score_element, gh_car (s));
-      common = common->common_refpoint (e, axis);
+      Score_element * e  = unsmob_element ( gh_car (s));
+      if (e)
+       common = common->common_refpoint (e, axis);
     }
   
   for (SCM s = support; s != SCM_EOL; s = gh_cdr (s))
     {
-      if (!SMOB_IS_TYPE_B (Score_element, gh_car (s)))
-       continue;
 
-      Score_element * e  = SMOB_TO_TYPE(Score_element, gh_car (s));
-      Real coord = e->relative_coordinate (common, axis);
+      Score_element * e  = unsmob_element ( gh_car (s));
+      if (e)
+       {
+         Real coord = e->relative_coordinate (common, axis);
 
-      dim.unite (coord + e->extent (axis));
+         dim.unite (coord + e->extent (axis));
+       }
     }
 
-
   if (dim.empty_b ())
     {
       dim = Interval(0,0);