From 64930a5ba0387859d246e578e58abc1c8b19a05a Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 30 Aug 2002 22:40:57 +0000 Subject: [PATCH] * lily/break-align-interface.cc (do_alignment): translate last break-align-group if it is invisible/empty. * scm/grob-description.scm (all-grob-descriptions): LeftEdge is not a BreakAlignGroup. Do not use Break_align_interface::alignment_callback --- ChangeLog | 10 ++++++++++ lily/break-align-interface.cc | 37 +++++++++++++++++------------------ lily/gdb.cc | 9 +++++++++ scm/grob-description.scm | 1 - 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 114f97bcea..d33ae4dd69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-08-31 Han-Wen Nienhuys + + * lily/break-align-interface.cc (do_alignment): translate last + break-align-group if it is invisible/empty. + + * scm/grob-description.scm (all-grob-descriptions): LeftEdge is + not a BreakAlignGroup. Do not use + Break_align_interface::alignment_callback + + 2002-08-30 Han-Wen Nienhuys * scripts/lilypond-book.py (LatexPaper.find_latex_dims): give more diff --git a/lily/break-align-interface.cc b/lily/break-align-interface.cc index c29c74b240..9bf4e4503a 100644 --- a/lily/break-align-interface.cc +++ b/lily/break-align-interface.cc @@ -71,7 +71,7 @@ void Break_align_interface::do_alignment (Grob *me) { Item * item = dynamic_cast (me); - + int rank = Paper_column::get_rank (item->get_column ()); Link_array elems = Pointer_group_interface__extract_grobs (me, (Grob*)0, "elements"); @@ -95,14 +95,13 @@ Break_align_interface::do_alignment (Grob *me) int edge_idx = -1; - while (idx < elems.size()) + while (idx < elems.size() - 1) { int next_idx = idx+1; - while ( next_idx < elems.size() && extents[next_idx].empty_b()) + while (next_idx < elems.size() && + extents[next_idx].empty_b() + && next_idx != elems.size() -1 ) next_idx++; - - if (next_idx == elems.size()) - break; Grob *l = elems[idx]; Grob *r = elems[next_idx]; @@ -133,18 +132,18 @@ Break_align_interface::do_alignment (Grob *me) table, but that gets icky when that grob is suicided for some reason. */ - for (SCM s = r->get_grob_property ("elements"); - gh_pair_p (s); s = gh_cdr (s)) - { - Grob * elt =unsmob_grob(gh_car (s)); - - SCM sym = elt->get_grob_property ("break-align-symbol"); - if (gh_symbol_p (sym)) - { - rsym = sym; - break; - } - } + for (SCM s = r->get_grob_property ("elements"); + gh_pair_p (s); s = gh_cdr (s)) + { + Grob * elt =unsmob_grob(gh_car (s)); + + SCM sym = elt->get_grob_property ("break-align-symbol"); + if (gh_symbol_p (sym)) + { + rsym = sym; + break; + } + } if (rsym == ly_symbol2scm("left-edge")) edge_idx = next_idx; @@ -183,7 +182,7 @@ Break_align_interface::do_alignment (Grob *me) offsets[next_idx] = extents[idx][RIGHT] + distance; else if (type == ly_symbol2scm("minimum-space")) offsets[next_idx] = extents[idx][RIGHT] >? distance; - + idx = next_idx; } diff --git a/lily/gdb.cc b/lily/gdb.cc index e8f71657e4..e9bfd001dc 100644 --- a/lily/gdb.cc +++ b/lily/gdb.cc @@ -1,6 +1,8 @@ #include "item.hh" #include "spanner.hh" +#include "paper-column.hh" +extern "C" { // thanks to GDBs wonderful casting abilities, we need these: Item* to_item (Grob* g) @@ -12,3 +14,10 @@ to_spanner (Grob*g) { return dynamic_cast (g); } + +Paper_column* +to_pc (Grob* g) +{ + return dynamic_cast (g); +} +} diff --git a/scm/grob-description.scm b/scm/grob-description.scm index 6f72730b9b..542c52141e 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -321,7 +321,6 @@ (LeftEdge . ( (break-align-symbol . left-edge) - (X-offset-callbacks . (,Break_align_interface::alignment_callback)) (X-extent-callback . ,Grob::point_dimension_callback) (breakable . #t) (space-alist . ( -- 2.39.5