#include "font-interface.hh"
#include "grob-array.hh"
#include "lookup.hh"
-#include "lookup.hh"
#include "moment.hh"
#include "output-def.hh"
#include "paper-score.hh"
(me, ly_symbol2scm ("elements"),
(scm_is_eq (align_sym, ly_symbol2scm ("staff-bar"))
? Bar_line::non_empty_barline
- : Break_alignment_interface::has_interface));
+ : has_interface<Break_alignment_interface>));
else
{
extract_grob_set (me, "elements", elts);
return t.smobbed_copy ();
}
+static bool grob_is_live (const Grob *g)
+{
+ return g && g->is_live ();
+}
+
/*
This is all too hairy. We use bounded-by-me to make sure that some
columns are kept "alive". Unfortunately, when spanners are suicided,
{
Grob *me = unsmob<Grob> (grob);
- SCM bbm = me->get_object ("bounded-by-me");
- Grob_array *ga = unsmob<Grob_array> (bbm);
- if (!ga)
- return SCM_UNSPECIFIED;
-
- vector<Grob *> &array (ga->array_reference ());
-
- for (vsize i = array.size (); i--;)
- {
- Grob *g = array[i];
-
- if (!g || !g->is_live ())
- /* UGH . potentially quadratic. */
- array.erase (array.begin () + i);
- }
+ if (Grob_array *ga = unsmob<Grob_array> (me->get_object ("bounded-by-me")))
+ ga->filter (grob_is_live);
return SCM_UNSPECIFIED;
}
bool has_notehead = false;
for (vsize i = 0; i < elts.size (); i++)
{
- if (Rhythmic_head::has_interface (elts[i]))
+ if (has_interface<Rhythmic_head> (elts[i]))
{
has_notehead = true;
if (dynamic_cast<Item *> (elts[i])->get_column () == me)