]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spacing-loose-columns.cc
Issue 4568: Check in Texinfo from upstream svn://svn.savannah.gnu.org/texinfo/trunk...
[lilypond.git] / lily / spacing-loose-columns.cc
index aad9dd0db7d089b36161838ebf2bb65bbe5dad0b..32ffe220322990408a2c00a19222bc4142b7983c 100644 (file)
@@ -28,6 +28,8 @@
 #include "moment.hh"
 #include "spacing-options.hh"
 
+using std::vector;
+
 /* Find the loose columns in POSNS, and drape them around the columns
    specified in BETWEEN-COLS.  */
 void
@@ -60,8 +62,8 @@ set_loose_columns (System *which, Column_x_positions const *posns)
           if (!loose->get_system ())
             break;
 
-          Paper_column *le = derived_unsmob<Paper_column> (scm_car (between));
-          Paper_column *re = derived_unsmob<Paper_column> (scm_cdr (between));
+          Paper_column *le = unsmob<Paper_column> (scm_car (between));
+          Paper_column *re = unsmob<Paper_column> (scm_cdr (between));
 
           if (! (le && re))
             break;
@@ -135,8 +137,8 @@ set_loose_columns (System *which, Column_x_positions const *posns)
           Paper_column *loose_col = dynamic_cast<Paper_column *> (clique[j]);
           Paper_column *next_col = dynamic_cast<Paper_column *> (clique[j + 1]);
 
-          Grob *spacing = Grob::unsmob (clique_col->get_object ("spacing"));
-          if (Grob *grace_spacing = Grob::unsmob (clique_col->get_object ("grace-spacing")))
+          Grob *spacing = unsmob<Grob> (clique_col->get_object ("spacing"));
+          if (Grob *grace_spacing = unsmob<Grob> (clique_col->get_object ("grace-spacing")))
             {
               spacing = grace_spacing;
             }
@@ -155,7 +157,7 @@ set_loose_columns (System *which, Column_x_positions const *posns)
             {
               Spring spring = Spacing_spanner::note_spacing (spacing, loose_col,
                                                              next_col, &options);
-              if (Note_spacing::has_interface (spacing))
+              if (has_interface<Note_spacing> (spacing))
                 spring = Note_spacing::get_spacing (spacing, next_col,
                                                     spring, options.increment_);
 
@@ -173,8 +175,8 @@ set_loose_columns (System *which, Column_x_positions const *posns)
             }
 
           Real loose_col_horizontal_length = loose_col->extent (loose_col, X_AXIS).length ();
-          base_note_space = max (base_note_space, loose_col_horizontal_length);
-          tight_note_space = max (tight_note_space, loose_col_horizontal_length);
+          base_note_space = std::max (base_note_space, loose_col_horizontal_length);
+          tight_note_space = std::max (tight_note_space, loose_col_horizontal_length);
 
           clique_spacing.push_back (base_note_space);
           clique_tight_spacing.push_back (tight_note_space);
@@ -193,7 +195,7 @@ set_loose_columns (System *which, Column_x_positions const *posns)
           sum_tight_spacing += clique_tight_spacing[j];
           sum_spacing += clique_spacing[j];
         }
-      Real scale_factor = max (0.0, min (1.0, (permissible_distance - left_padding - sum_tight_spacing) / (sum_spacing - sum_tight_spacing)));
+      Real scale_factor = std::max (0.0, std::min (1.0, (permissible_distance - left_padding - sum_tight_spacing) / (sum_spacing - sum_tight_spacing)));
       for (vsize j = clique.size () - 2; j > 0; j--)
         {
           Paper_column *clique_col = dynamic_cast<Paper_column *> (clique[j]);