]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/accidental.cc
Merge remote-tracking branch 'origin/translation'
[lilypond.git] / lily / accidental.cc
index 0cf270f52aa60124a31fdb836fda1704fb71ec53..dc3c873878f095709d4c7187bf37f30bcbbf0849 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2001--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2001--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -83,14 +83,14 @@ Accidental_interface::horizontal_skylines (SCM smob)
    * We use the more basic get_stencil.
    */
   Stencil *my_stencil = unsmob_stencil (get_stencil (me));
+  if (!my_stencil)
+    return Skyline_pair ().smobbed_copy ();
+
   Skyline_pair *sky =
     Skyline_pair::unsmob
       (Stencil::skylines_from_stencil
         (my_stencil->smobbed_copy (), 0.0, Y_AXIS));
 
-  if (!sky)
-    return Skyline_pair ().smobbed_copy ();
-
   SCM alist = me->get_property ("glyph-name-alist");
   SCM alt = me->get_property ("alteration");
   string glyph_name = robust_scm2string (ly_assoc_get (alt, alist, SCM_BOOL_F),
@@ -163,15 +163,17 @@ Accidental_interface::get_stencil (Grob *me)
   SCM alist = me->get_property ("glyph-name-alist");
   SCM alt = me->get_property ("alteration");
   SCM glyph_name = ly_assoc_get (alt, alist, SCM_BOOL_F);
+  Stencil mol;
 
   if (!scm_is_string (glyph_name))
     {
       me->warning (_f ("Could not find glyph-name for alteration %s",
                        ly_scm_write_string (alt).c_str ()));
-      return SCM_EOL;
+      mol = fm->find_by_name ("noteheads.s1cross");
     }
+  else
+    mol = fm->find_by_name (ly_scm2string (glyph_name));
 
-  Stencil mol (fm->find_by_name (ly_scm2string (glyph_name)));
   if (to_boolean (me->get_property ("restore-first")))
     {
       /*