]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob.cc
Merge branch 'master' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / grob.cc
index e37fc94302bba8e1c2012db54952ee0287fa5e63..5660b688b81fe477be9a4a538a5d69f02f1f074d 100644 (file)
@@ -19,6 +19,7 @@
 #include "music.hh"
 #include "output-def.hh"
 #include "pointer-group-interface.hh"
+#include "program-option.hh"
 #include "stencil.hh"
 #include "stream-event.hh"
 #include "system.hh"
@@ -533,6 +534,9 @@ Grob::fixup_refpoint ()
 void
 Grob::warning (string s) const
 {
+  if (get_program_option ("warning-as-error"))
+    error (s);
+
   SCM cause = self_scm ();
   while (Grob *g = unsmob_grob (cause))
     cause = g->get_property ("cause");
@@ -559,6 +563,9 @@ Grob::name () const
 void
 Grob::programming_error (string s) const
 {
+  if (get_program_option ("warning-as-error"))
+    error (s);
+
   SCM cause = self_scm ();
   while (Grob *g = unsmob_grob (cause))
     cause = g->get_property ("cause");
@@ -569,7 +576,7 @@ Grob::programming_error (string s) const
   if (Music *m = unsmob_music (cause))
     m->origin ()->message (s);
   else if (Stream_event *ev = unsmob_stream_event (cause))
-    ev->origin ()->warning (s);
+    ev->origin ()->message (s);
   else
     ::message (s);
 }
@@ -606,8 +613,8 @@ ADD_INTERFACE (Grob,
               " properties are variables that are specific to one grob."
               "  Typically, lists of other objects, or results from"
               " computations are stored in mutable properties.  In"
-              " particular, every call to @code{set-grob-property} (or its"
-              " C++ equivalent) sets a mutable property.\n"
+              " particular, every call to @code{ly:grob-set-property!}"
+              " (or its C++ equivalent) sets a mutable property.\n"
               "\n"
               "The properties @code{after-line-breaking} and"
               " @code{before-line-breaking} are dummies that are not"
@@ -702,17 +709,6 @@ Grob::stencil_width (SCM smob)
   return grob_stencil_extent (me, X_AXIS);
 }
 
-Stream_event*
-Grob::event_cause ()
-{
-  SCM cause = get_property ("cause");
-  if (to_boolean (Stream_event::smob_p (cause)))
-    return unsmob_stream_event (cause);
-  else if (to_boolean (Grob::smob_p (cause)))
-    return unsmob_grob (cause)->event_cause ();
-
-  return 0;
-}
 
 Grob *
 common_refpoint_of_list (SCM elist, Grob *common, Axis a)