X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fkey-engraver.cc;h=971f55317295e8a56387a6f508dc8a41f20cd96a;hb=57a6fdce712bbdc538b712b319d28366e05b7495;hp=5b48b1d78afbdda9303407c2ee136b2ae11d7a2c;hpb=99b6f3aa3558b01c9d4158b19a1f1794c534f89c;p=lilypond.git diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 5b48b1d78a..971f553172 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2014 Han-Wen Nienhuys + Copyright (C) 1997--2015 Han-Wen Nienhuys 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 ()); }