Reviewers: Graham Percival,
Message:
On 2011/01/30 15:29:15, Graham Percival wrote:
This patch appears to be have been created in "reversed" fashion --
I'm certain
that you meant to *add* a new regtest, for example, instead of
*deleting* one.
That is understandable, but I really did mean it when I said "remove
regtest" in the description.
Rune corrected the key cancellations in 2006, but he made the correction
selectable using extraNatural. I propose to have the correct behavior
all the time, and to delete the regtest that ensures that
extraNatural=#f selects the old, wrong, behavior.
The other two key-signature* regtests give ample coverage of the
behavior we should keep.
Description:
Make KeyCancellation independent of extraNatural
Simplify code, remove regtest that tested partial key cancellations
Please review this at http://codereview.appspot.com/4014041/
Affected files:
D input/regression/key-signature-cancellation-extra-natural.ly
M lily/key-engraver.cc
Index: input/regression/key-signature-cancellation-extra-natural.ly
diff --git a/input/regression/key-signature-cancellation-extra-natural.ly
b/input/regression/key-signature-cancellation-extra-natural.ly
deleted file mode 100644
index
676e1dc2ef4bc73376e495fab8d18b6d4faef5d8..0000000000000000000000000000000000000000
--- a/input/regression/key-signature-cancellation-extra-natural.ly
+++ /dev/null
@@ -1,23 +0,0 @@
-\header {
-
- texidoc = "If @code{extraNatural} is set then keys that are not
- altered farther away (eg from sharp to double sharp) are
- cancelled. Otherwise only keys that do not occur in the new key
- signature are cancelled." }
-
-
-\version "2.12.0"
-
-\paper {
- ragged-right = ##t
-}
-{
- \set Staff.extraNatural = ##f
- \key fes \major r1
- \key as \major r1_"No B-natural (#f)"
- \set Staff.extraNatural = ##t
- \key gis \major r1
- \key b \major r1_"with F-natural (#t)"
-
-}
-
Index: lily/key-engraver.cc
diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc
index
e67247cd8c3c8a188bd40f9fab4363bfcd46f5bf..d527f4cdfeb2df4a8d32458a1fb0f4943cb079ff
100644
--- a/lily/key-engraver.cc
+++ b/lily/key-engraver.cc
@@ -77,7 +77,6 @@ Key_engraver::create_key (bool is_default)
SCM last = get_property ("lastKeySignature");
SCM key = get_property ("keySignature");
- bool extranatural = to_boolean (get_property ("extraNatural"));
if ((to_boolean (get_property ("printKeyCancellation"))
|| key == SCM_EOL)
@@ -90,9 +89,8 @@ 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
- || (extranatural
- && (ly_scm2rational (scm_cdr (new_alter_pair)) -
old_alter)*old_alter
- < Rational (0)))
+ || (ly_scm2rational (scm_cdr (new_alter_pair)) -
old_alter) * old_alter
+ < Rational (0))
{
*tail = scm_cons (scm_car (s), *tail);
tail = SCM_CDRLOC (*tail);
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel