]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob.cc
programming_error messages should NOT be translated
[lilypond.git] / lily / grob.cc
index 993b18a31b5648e1c47a4039c386b11e4cf3fa1b..36aadb4e938b549df05260d98cf7dc13030e6455 100644 (file)
@@ -88,13 +88,16 @@ Grob::Grob (Grob const &s)
   self_scm_ = SCM_EOL;
 
   immutable_property_alist_ = s.immutable_property_alist_;
-  mutable_property_alist_ = ly_deep_copy (s.mutable_property_alist_);
+  mutable_property_alist_ = SCM_EOL;
   interfaces_ = s.interfaces_;
   object_alist_ = SCM_EOL;
 
   layout_ = 0;
 
   smobify_self ();
+
+  mutable_property_alist_ = ly_deep_copy (s.mutable_property_alist_);
+
 }
 
 Grob::~Grob ()
@@ -283,7 +286,7 @@ Grob::translate_axis (Real y, Axis a)
 {
   if (isinf (y) || isnan (y))
     {
-      programming_error (_ ("Infinity or NaN encountered"));
+      programming_error ("Infinity or NaN encountered");
       return;
     }
 
@@ -573,11 +576,24 @@ Grob::fixup_refpoint ()
   MESSAGES
 ****************************************************************/
 void
-Grob::warning (string s) const
+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");
+
+  /* ES TODO: cause can't be Music*/
+  if (Music *m = unsmob_music (cause))
+    m->origin ()->programming_error (s);
+  else if (Stream_event *ev = unsmob_stream_event (cause))
+    ev->origin ()->programming_error (s);
+  else
+    ::programming_error (s);
+}
 
+void
+Grob::warning (string s) const
+{
   SCM cause = self_scm ();
   while (Grob *g = unsmob_grob (cause))
     cause = g->get_property ("cause");
@@ -600,27 +616,6 @@ Grob::name () const
   return scm_is_symbol (nm) ? ly_symbol2string (nm) : this->class_name ();
 }
 
-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");
-
-  s = _f ("programming error: %s", s);
-
-  /* ES TODO: cause can't be Music*/
-  if (Music *m = unsmob_music (cause))
-    m->origin ()->message (s);
-  else if (Stream_event *ev = unsmob_stream_event (cause))
-    ev->origin ()->message (s);
-  else
-    ::message (s);
-}
-
 ADD_INTERFACE (Grob,
                "A grob represents a piece of music notation.\n"
                "\n"