DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM));
- static bool less (Grob *const &s1,
- Grob *const &s2);
+ static bool less (Grob *s1, Grob *s2);
static int get_column_rank (Item *);
static int get_position (Item *);
static Item *head (Item *);
DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM));
- static bool less (Grob *const &s1,
- Grob *const &s2);
+ static bool less (Grob *s1, Grob *s2);
};
#endif // TIE_HH
}
bool
-Semi_tie::less (Grob *const &s1,
- Grob *const &s2)
+Semi_tie::less (Grob *g1, Grob *g2)
{
- return Tie::get_position_generic (s1) < Tie::get_position_generic (s2);
+ Item *i1 = dynamic_cast<Item *> (g1);
+ Item *i2 = dynamic_cast<Item *> (g2);
+ if (i1 && i2) {
+ return get_position (i1) < get_position (i2);
+ }
+
+ programming_error ("grob is not a semi-tie");
+ return false;
}
Item *
#include "semi-tie-column.hh"
bool
-Tie::less (Grob *const &s1, Grob *const &s2)
+Tie::less (Grob *g1, Grob *g2)
{
- return get_position_generic (s1) < get_position_generic (s2);
+ Spanner *s1 = dynamic_cast<Spanner *> (g1);
+ Spanner *s2 = dynamic_cast<Spanner *> (g2);
+ if (s1 && s2) {
+ return get_position (s1) < get_position (s2);
+ }
+
+ programming_error ("grob is not a tie");
+ return false;
}
void