From f8ef86ff0dee2da0a03d3ebc9d6edc5167aeed30 Mon Sep 17 00:00:00 2001 From: hanwen Date: Mon, 16 Feb 2004 15:21:24 +0000 Subject: [PATCH] * lily/slur.cc (broken_trend_offset): robustness fix. * lily/context.cc (find_create_context): go to Score if it exists. --- ChangeLog | 4 ++++ lily/context-def.cc | 1 + lily/context.cc | 4 ++-- lily/score-context.cc | 11 ++++------- lily/slur.cc | 6 +++++- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d24b11d59..c4d1e59f18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2004-02-16 Han-Wen Nienhuys + * lily/slur.cc (broken_trend_offset): robustness fix. + + * VERSION: release 2.1.24 + * lily/context.cc (find_create_context): go to Score if it exists. * lily/context-scheme.cc: new file. diff --git a/lily/context-def.cc b/lily/context-def.cc index c976fb6325..d91c60a03b 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -38,6 +38,7 @@ Context_def::mark_smob (SCM smob) scm_gc_mark (me->translator_mods_); scm_gc_mark (me->property_ops_); scm_gc_mark (me->translator_group_type_); + return me->context_name_; } diff --git a/lily/context.cc b/lily/context.cc index 6dff7f838b..0374885195 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -25,7 +25,6 @@ Context::is_removable () const ; } - void Context::check_removal () { @@ -99,7 +98,8 @@ Context::Context () Context * Context::find_existing_context (SCM n, String id) { - if ((is_alias (n) && (id_string_ == id || id.is_empty ())) || n == ly_symbol2scm ("Current")) + if ((is_alias (n) && (id_string_ == id || id.is_empty ())) + || n == ly_symbol2scm ("Current")) return this; Context* r = 0; diff --git a/lily/score-context.cc b/lily/score-context.cc index fe78acdf5a..4048df84de 100644 --- a/lily/score-context.cc +++ b/lily/score-context.cc @@ -1,17 +1,14 @@ /* -score-context.cc -- implement + score-context.cc -- implement Score_context -source file of the GNU LilyPond music typesetter - -(c) 2004 Han-Wen Nienhuys - - */ + source file of the GNU LilyPond music typesetter + (c) 2004 Han-Wen Nienhuys +*/ #include "score-context.hh" #include "score-translator.hh" - void Score_context::prepare (Moment w) { diff --git a/lily/slur.cc b/lily/slur.cc index ad1d6097c0..3b3ff7f129 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -258,7 +258,11 @@ Slur::broken_trend_offset (Grob *me, Direction dir) if (Spanner *mother = dynamic_cast (me->original_)) { int k = broken_spanner_index (dynamic_cast (me)); - Grob *neighbour = mother->broken_intos_[k + dir]; + int j = k + dir; + if (j < 0 || j >= mother->broken_intos_.size ()) + return o; + + Grob *neighbour = mother->broken_intos_[j]; if (dir == RIGHT) neighbour->set_grob_property ("direction", me->get_grob_property ("direction")); -- 2.39.5