]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/horizontal-bracket.cc
Issue 4550 (1/2) Avoid "using namespace std;" in included files
[lilypond.git] / lily / horizontal-bracket.cc
index 2ad243a1d9cf606fee07cfa9b5d739b859653aa9..000da711fe7bbba3657dbbe65c485aee1f136d4a 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2002--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2002--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
@@ -30,6 +30,8 @@
 #include "spanner.hh"
 #include "item.hh"
 
+using std::vector;
+
 Stencil
 Horizontal_bracket::make_bracket (Grob *me,
                                   Real length,
@@ -53,8 +55,7 @@ Horizontal_bracket::make_bracket (Grob *me,
     = robust_scm2booldrul (me->get_property ("connect-to-neighbor"),
                            Drul_array<bool> (false, false));
 
-  Direction d = LEFT;
-  do
+  for (LEFT_and_RIGHT (d))
     {
       if (connect_to_other[d])
         {
@@ -63,7 +64,6 @@ Horizontal_bracket::make_bracket (Grob *me,
           shorten[d] = 0.0;
         }
     }
-  while (flip (&d) != LEFT);
 
   /*
     ugh, Tuplet_bracket should use Horizontal_bracket, not the other way around.
@@ -103,7 +103,7 @@ MAKE_SCHEME_CALLBACK (Horizontal_bracket, print, 1);
 SCM
 Horizontal_bracket::print (SCM smob)
 {
-  Spanner *me = unsmob_spanner (smob);
+  Spanner *me = unsmob<Spanner> (smob);
   extract_grob_set (me, "columns", gs);
 
   vector<Grob *> enclosed = gs;
@@ -113,14 +113,12 @@ Horizontal_bracket::print (SCM smob)
       return SCM_EOL;
     }
 
-  Direction d = LEFT;
-  do
+  for (LEFT_and_RIGHT (d))
     {
       Item *b = me->get_bound (d);
       if (b->break_status_dir ())
         enclosed.push_back (b);
     }
-  while (flip (&d) != LEFT);
 
   Stencil b = make_enclosing_bracket (me, me, enclosed, X_AXIS, get_grob_direction (me));
   return b.smobbed_copy ();