]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spacing-spanner.cc
Issue 2491: Macro for(UP_and_DOWN) and 3 similar.
[lilypond.git] / lily / spacing-spanner.cc
index b09384f7df1f03d11744e097909cb4f471a48805..657ff0cd6a9d2b6541b87bfdd8f6a789dbdcf13b 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1999--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1999--2012 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
@@ -261,8 +261,7 @@ set_column_rods (vector<Grob *> const &cols, Real padding)
           Real left_stickout = skys ? (*skys)[RIGHT].max_height () : 0.0;
           bool done = true;
 
-          Direction d = LEFT;
-          do
+          for (LEFT_and_RIGHT (d))
             {
               if (j < i - 1)
                 cur_dist[d] += distances[j];
@@ -287,8 +286,10 @@ set_column_rods (vector<Grob *> const &cols, Real padding)
 
               cur_dist[d] = max (cur_dist[d], dist);
               done = done && !touches;
+
+              if (!rb)
+                break;
             }
-          while (flip (&d) != LEFT && rb);
 
           /* we need the empty check for gregorian notation, where there are a lot of
              extraneous paper-columns that we need to skip over */