]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/page-breaking.cc (find_chunks_and_breaks): ignore breaks
authorJoe Neeman <joeneeman@gmail.com>
Tue, 19 Sep 2006 22:57:34 +0000 (22:57 +0000)
committerJoe Neeman <joeneeman@gmail.com>
Tue, 19 Sep 2006 22:57:34 +0000 (22:57 +0000)
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
lily/page-breaking.cc
lily/source-file.cc

index 5668f46af9ff88b2cc5460961cf1d4d3c471d934..24f7fdad186daffd219d375861a4070dd3a9527f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-09-20  Joe Neeman  <joeneeman@gmail.com>
+
+       * 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  <hanwen@lilypond.org>
 
        * lily/tie-engraver.cc (process_music): also set tieMelismaBusy if
index 528b61b8540b95ceab203924dad942ac3c8baf71..fee3fa26d914ebd52cad0654302619b160108996 100644 (file)
@@ -264,7 +264,7 @@ Page_breaking::find_chunks_and_breaks (Break_predicate is_break)
          vector<vsize> 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]);
index c846c9a3761dfc14bd5c080b038b110bfe1cea99..56b2e57d72937d0a2501fa83c132b0e3ee5af16d 100644 (file)
@@ -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<char const*> (),
-                     lo, hi);
-
+  lo = lower_bound (newline_locations_,
+                   pos_str0,
+                   less<char const*> (),
+                   lo, hi);
 
   if (*pos_str0 == '\n')
     lo--;