]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spacing-engraver.cc
Issue 4550 (2/2) Avoid "using namespace std;" in included files
[lilypond.git] / lily / spacing-engraver.cc
index 80892fac6bed75ba90fdab2c27f04e496fcce436..7efa1e649cc7bc3e13c463ec765ccaac85b2b3db 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1999--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1999--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -29,6 +29,8 @@
 
 #include "translator.icc"
 
+using std::vector;
+
 struct Rhythmic_tuple
 {
   Grob_info info_;
@@ -123,7 +125,7 @@ Spacing_engraver::start_spanner ()
 
   spacing_ = make_spanner ("SpacingSpanner", SCM_EOL);
   spacing_->set_bound (LEFT,
-                       unsmob_grob (get_property ("currentCommandColumn")));
+                       unsmob<Grob> (get_property ("currentCommandColumn")));
 }
 
 void
@@ -137,7 +139,7 @@ Spacing_engraver::stop_spanner ()
 {
   if (spacing_)
     {
-      Grob *p = unsmob_grob (get_property ("currentCommandColumn"));
+      Grob *p = unsmob<Grob> (get_property ("currentCommandColumn"));
 
       spacing_->set_bound (RIGHT, p);
       spacing_ = 0;
@@ -194,17 +196,17 @@ void
 Spacing_engraver::stop_translation_timestep ()
 {
   Paper_column *musical_column
-    = dynamic_cast<Paper_column *> (unsmob_grob (get_property ("currentMusicalColumn")));
+    = unsmob<Paper_column> (get_property ("currentMusicalColumn"));
 
   if (!spacing_)
     start_spanner ();
 
   musical_column->set_object ("spacing", spacing_->self_scm ());
-  unsmob_grob (get_property ("currentCommandColumn"))
+  unsmob<Grob> (get_property ("currentCommandColumn"))
   ->set_object ("spacing", spacing_->self_scm ());
 
   SCM proportional = get_property ("proportionalNotationDuration");
-  if (unsmob_moment (proportional))
+  if (unsmob<Moment> (proportional))
     {
       musical_column->set_property ("shortest-playing-duration", proportional);
       musical_column->set_property ("shortest-starter-duration", proportional);
@@ -220,7 +222,7 @@ Spacing_engraver::stop_translation_timestep ()
       if (ev)
         {
           Moment m = get_event_length (ev);
-          shortest_playing = min (shortest_playing, m);
+          shortest_playing = std::min (shortest_playing, m);
         }
     }
   Moment starter;
@@ -231,13 +233,13 @@ Spacing_engraver::stop_translation_timestep ()
       Moment m = get_event_length (now_durations_[i].info_.event_cause ());
       if (m.to_bool ())
         {
-          starter = min (starter, m);
+          starter = std::min (starter, m);
           playing_durations_.insert (now_durations_[i]);
         }
     }
   now_durations_.clear ();
 
-  shortest_playing = min (shortest_playing, starter);
+  shortest_playing = std::min (shortest_playing, starter);
 
   assert (starter.to_bool ());
   SCM sh = shortest_playing.smobbed_copy ();