]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/rest.cc
Avoid python 2.5 due to GUB using 2.4.5.
[lilypond.git] / lily / rest.cc
index 0bb61444b4c025882f0bb924cb531350c246102d..8e45405de278dbd4ea5040dfc3259c6a2164a112 100644 (file)
@@ -37,7 +37,6 @@ Rest::y_offset_callback (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
   int duration_log = scm_to_int (me->get_property ("duration-log"));
-  int line_count = Staff_symbol_referencer::line_count (me);
   Real ss = Staff_symbol_referencer::staff_space (me);
 
   bool position_override = scm_is_number (me->get_property ("staff-position"));
@@ -45,8 +44,8 @@ Rest::y_offset_callback (SCM smob)
 
   if (position_override)
     {
-      amount =
-        robust_scm2double (me->get_property ("staff-position"), 0) * 0.5 * ss;
+      amount
+        robust_scm2double (me->get_property ("staff-position"), 0) * 0.5 * ss;
 
       /*
         semibreve rests are positioned one staff line off
@@ -69,21 +68,21 @@ Rest::y_offset_callback (SCM smob)
         make a semibreve rest hang from the next line,
         except for a single line staff
       */
-      if (duration_log == 0 && line_count > 1)
+      if (duration_log == 0 && Staff_symbol_referencer::line_count (me) > 1)
         pos += 2;
 
       /*
         make sure rest is aligned to a staff line
       */
-      if (Grob *staff = Staff_symbol_referencer::get_staff_symbol(me))
+      if (Grob *staff = Staff_symbol_referencer::get_staff_symbol (me))
         {
           std::vector<Real> linepos = Staff_symbol::line_positions (staff);
-          std::sort(linepos.begin(), linepos.end());
+          std::sort (linepos.begin (), linepos.end ());
           std::vector<Real>::const_iterator it
-            = std::lower_bound(linepos.begin(), linepos.end(), pos);
-          if (it != linepos.end())
+            = std::lower_bound (linepos.begin (), linepos.end (), pos);
+          if (it != linepos.end ())
             {
-              pos = (int)ceil(*it);
+              pos = (int)ceil (*it);
             }
         }
 
@@ -127,8 +126,8 @@ Rest::glyph_name (Grob *me, int durlog, string style, bool try_ledgers)
       */
       if (-1 <= durlog && durlog <= 1)
         is_ledgered = !Staff_symbol_referencer::on_staff_line (me, pos)
-          && !(durlog == -1
-               && Staff_symbol_referencer::on_staff_line (me, pos + 2));
+                      && !(durlog == -1
+                           && Staff_symbol_referencer::on_staff_line (me, pos + 2));
     }
 
   string actual_style (style.c_str ());