From fb5d36ef6d026fdaa2b5d6c207eefd39374bff97 Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Tue, 19 Sep 2006 22:57:34 +0000 Subject: [PATCH] * lily/page-breaking.cc (find_chunks_and_breaks): ignore breaks that happen at the start of a score: having a zero-length chunk was messing up min_system_count calculations. * lily/source-file.cc (get_line): lower_bound, not binary_search. Fixes problem where point-and-click would always point to the first line. --- ChangeLog | 10 ++++++++++ lily/page-breaking.cc | 2 +- lily/source-file.cc | 9 ++++----- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5668f46af9..24f7fdad18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-09-20 Joe Neeman + + * lily/page-breaking.cc (find_chunks_and_breaks): ignore breaks + that happen at the start of a score: having a zero-length + chunk was messing up min_system_count calculations. + + * lily/source-file.cc (get_line): lower_bound, not + binary_search. Fixes problem where point-and-click would + always point to the first line. + 2006-09-20 Han-Wen Nienhuys * lily/tie-engraver.cc (process_music): also set tieMelismaBusy if diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc index 528b61b854..fee3fa26d9 100644 --- a/lily/page-breaking.cc +++ b/lily/page-breaking.cc @@ -264,7 +264,7 @@ Page_breaking::find_chunks_and_breaks (Break_predicate is_break) vector line_breaker_columns; line_breaker_columns.push_back (0); - for (vsize j = 0; j < cols.size (); j++) + for (vsize j = 1; j < cols.size (); j++) { bool last = j == cols.size () - 1; bool break_point = is_break (cols[j]); diff --git a/lily/source-file.cc b/lily/source-file.cc index c846c9a376..56b2e57d72 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -335,11 +335,10 @@ Source_file::get_line (char const *pos_str0) const if (newline_locations_[hi - 1] < pos_str0) return hi; - lo = binary_search (newline_locations_, - pos_str0, - less (), - lo, hi); - + lo = lower_bound (newline_locations_, + pos_str0, + less (), + lo, hi); if (*pos_str0 == '\n') lo--; -- 2.39.5