From 81abebcfecdb22d2e7b6b8e2a6d9f758aa45a13a Mon Sep 17 00:00:00 2001 From: Neil Puttock Date: Wed, 24 Jun 2009 23:25:48 +0100 Subject: [PATCH] Fix #767. - in Rhythmic_head::dot_count () use robust_scm2int to ensure sane value is returned even if Dots isn't live. (cherry picked from commit 6538e1b152ea115bf70e83f89627c07477472e53) --- input/regression/collision-harmonic-no-dots.ly | 17 +++++++++++++++++ lily/rhythmic-head.cc | 10 +++++----- 2 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 input/regression/collision-harmonic-no-dots.ly diff --git a/input/regression/collision-harmonic-no-dots.ly b/input/regression/collision-harmonic-no-dots.ly new file mode 100644 index 0000000000..8fe383c67b --- /dev/null +++ b/input/regression/collision-harmonic-no-dots.ly @@ -0,0 +1,17 @@ +\version "2.13.2" + +\header { + texidoc = "Collision resolution involving dotted harmonic heads +succeeds when dots are hidden since @code{rhythmic-head-interface} +will only retrieve @code{'dot-count} from live grobs. +" +} + +\relative c' { + << + { 2. } + \\ + { e2. } + >> + r4 +} diff --git a/lily/rhythmic-head.cc b/lily/rhythmic-head.cc index 5919c9119b..659ba339b7 100644 --- a/lily/rhythmic-head.cc +++ b/lily/rhythmic-head.cc @@ -8,11 +8,11 @@ #include "rhythmic-head.hh" -#include "warn.hh" +#include "item.hh" #include "rest.hh" -#include "stem.hh" #include "staff-symbol-referencer.hh" -#include "item.hh" +#include "stem.hh" +#include "warn.hh" Item * Rhythmic_head::get_dots (Grob *me) @@ -32,7 +32,7 @@ int Rhythmic_head::dot_count (Grob *me) { return get_dots (me) - ? scm_to_int (get_dots (me)->get_property ("dot-count")) : 0; + ? robust_scm2int (get_dots (me)->get_property ("dot-count"), 0) : 0; } void @@ -50,7 +50,7 @@ Rhythmic_head::duration_log (Grob *me) ADD_INTERFACE (Rhythmic_head, "Note head or rest.", - + /* properties */ "dot " "duration-log " -- 2.39.2