]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/key-engraver.cc
Doc: CG - Re-organize information about 'Patches'
[lilypond.git] / lily / key-engraver.cc
index 5b48b1d78afbdda9303407c2ee136b2ae11d7a2c..971f55317295e8a56387a6f508dc8a41f20cd96a 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2015 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
@@ -82,7 +82,7 @@ Key_engraver::create_key (bool is_default)
       SCM key = get_property ("keyAlterations");
 
       if ((to_boolean (get_property ("printKeyCancellation"))
-           || key == SCM_EOL)
+           || scm_is_null (key))
           && !scm_is_eq (last, key))
         {
           SCM restore = SCM_EOL;
@@ -90,7 +90,7 @@ Key_engraver::create_key (bool is_default)
             {
               SCM new_alter_pair = scm_assoc (scm_caar (s), key);
               Rational old_alter = robust_scm2rational (scm_cdar (s), 0);
-              if (new_alter_pair == SCM_BOOL_F
+              if (scm_is_false (new_alter_pair)
                   || ((ly_scm2rational (scm_cdr (new_alter_pair)) - old_alter) * old_alter
                       < Rational (0)))
                 {
@@ -140,8 +140,7 @@ Key_engraver::acknowledge_clef (Grob_info /* info */)
 void
 Key_engraver::acknowledge_bar_line (Grob_info /* info */)
 {
-  if (scm_is_pair (get_property ("keyAlterations")))
-    create_key (true);
+  create_key (true);
 }
 
 void
@@ -209,7 +208,7 @@ Key_engraver::initialize ()
   context ()->set_property ("keyAlterations", SCM_EOL);
   context ()->set_property ("lastKeyAlterations", SCM_EOL);
 
-  Pitch p (0, 0, 0);
+  Pitch p;
   context ()->set_property ("tonic", p.smobbed_copy ());
 }