From bbce29ac86183fafea385e3c545a4091652bcaae Mon Sep 17 00:00:00 2001 From: Mike Solomon Date: Sat, 2 Nov 2013 16:35:44 +0100 Subject: [PATCH] Issue 3631: 2.17 does a worse job with vertical spacing and/or the page layout than 2.16 Looks for prebroken pieces of dead items in the pure relevant function. Even if the item is dead, its prebroken pieces may not be. We need to check them and build them into the pure skylines of axis groups used by the align interface. --- lily/axis-group-interface.cc | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index d4d3d41022..1e945f2f9e 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -494,16 +494,26 @@ Axis_group_interface::internal_calc_pure_relevant_grobs (Grob *me, const string for (vsize i = 0; i < elts.size (); i++) { if (elts[i] && elts[i]->is_live ()) + relevant_grobs.push_back (elts[i]); + /* + TODO (mikesol): it is probably bad that we're reading prebroken + pieces from potentially suicided elements. This behavior + has been in current master since at least 2.16. + + We need to fully suicide all Items, meaning that their + prebroken pieces should not be accessible, which means that + Item::handle_prebroken_dependencies should only be called + AFTER this list is composed. The list composition function + should probably not check for suicided items or NULL pointers + but leave that to the various methods that use it. + */ + if (Item *it = dynamic_cast (elts[i])) { - relevant_grobs.push_back (elts[i]); - if (Item *it = dynamic_cast (elts[i])) + for (LEFT_and_RIGHT (d)) { - for (LEFT_and_RIGHT (d)) - { - Item *piece = it->find_prebroken_piece (d); - if (piece && piece->is_live ()) - relevant_grobs.push_back (piece); - } + Item *piece = it->find_prebroken_piece (d); + if (piece && piece->is_live ()) + relevant_grobs.push_back (piece); } } } -- 2.39.5