]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob.cc
Fix 1240.
[lilypond.git] / lily / grob.cc
index 882808180c6f2509cd7c807b5d22fed795f8239e..aa9c1d40f4bee450f9d2940d530719db68b3d986 100644 (file)
@@ -191,6 +191,16 @@ Grob::get_system () const
   return 0;
 }
 
+/* This version of get_system is more reliable than this->get_system ()
+   before line-breaking has been done, at which point there is only
+   one system in the whole score and we can find it just by following
+   parent pointers. */
+System *
+Grob::get_system(Grob *me)
+{
+  Grob *p = me->get_parent (X_AXIS);
+  return p ? get_system (p) : dynamic_cast<System *>(me);
+}
 
 void
 Grob::handle_broken_dependencies ()