]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/paper-column.cc
Issue 5028 Correct some typos german doc
[lilypond.git] / lily / paper-column.cc
index 3ea5a89f0538a37b236c412e9744ba5a378ad61f..da3807c31d6f4ddb33fb75edf69c24ec3baf8175 100644 (file)
@@ -390,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,
@@ -404,21 +409,8 @@ Paper_column::before_line_breaking (SCM grob)
 {
   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;
 }