X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpaper-column.cc;h=da3807c31d6f4ddb33fb75edf69c24ec3baf8175;hb=49b253c37b3129d6c2e69c7133495213419e5dbd;hp=c5f6cc5b95718a6c566decd15e7c09b079d70f80;hpb=207f71b8b2ab9ca550e841615bedce393e652ca6;p=lilypond.git diff --git a/lily/paper-column.cc b/lily/paper-column.cc index c5f6cc5b95..da3807c31d 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -39,9 +39,6 @@ #include "text-interface.hh" #include "warn.hh" -using std::string; -using std::vector; - Grob * Paper_column::clone () const { @@ -393,6 +390,11 @@ Paper_column::print (SCM p) 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, @@ -407,21 +409,8 @@ Paper_column::before_line_breaking (SCM grob) { Grob *me = unsmob (grob); - SCM bbm = me->get_object ("bounded-by-me"); - Grob_array *ga = unsmob (bbm); - if (!ga) - return SCM_UNSPECIFIED; - - vector &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 (me->get_object ("bounded-by-me"))) + ga->filter (grob_is_live); return SCM_UNSPECIFIED; }