]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spacing-interface.cc
Bump documentation license to v1.3+.
[lilypond.git] / lily / spacing-interface.cc
index 1cf1a02cdc941a30a54e2c0e7cfab31aac668484..6e8027bc8c31b445833bc842593c188651175aa7 100644 (file)
@@ -4,7 +4,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2007 Joe Neeman <joeneeman@gmail.com>
+  (c) 2007--2009 Joe Neeman <joeneeman@gmail.com>
 */
 
 #include "spacing-interface.hh"
@@ -17,6 +17,7 @@
 #include "paper-column.hh"
 #include "separation-item.hh"
 #include "skyline.hh"
+#include "skyline-pair.hh"
 #include "system.hh"
 
 /* return the right-pointing skyline of the left-items and the left-pointing
@@ -91,11 +92,7 @@ Spacing_interface::minimum_distance (Grob *me, Grob *right)
 }
 
 /*
-  Compute the column of the right-items.  This is a big function,
-  since RIGHT-ITEMS may span more columns (eg. if a clef is inserted,
-  this will add a new column to RIGHT-ITEMS. Here we look at the
-  columns, and return the left-most. If there are multiple columns, we
-  prune RIGHT-ITEMS.
+  Compute the left-most column of the right-items.
 */
 Item *
 Spacing_interface::right_column (Grob *me)
@@ -106,7 +103,6 @@ Spacing_interface::right_column (Grob *me)
   Grob_array *a = unsmob_grob_array (me->get_object ("right-items"));
   Item *mincol = 0;
   int min_rank = INT_MAX;
-  bool prune = false;
   for (vsize i = 0; a && i < a->size (); i++)
     {
       Item *ri = a->item (i);
@@ -117,23 +113,10 @@ Spacing_interface::right_column (Grob *me)
       if (rank < min_rank)
        {
          min_rank = rank;
-         if (mincol)
-           prune = true;
-
          mincol = col;
        }
     }
 
-  if (prune && a)
-    {
-      vector<Grob*> &right = a->array_reference ();
-      for (vsize i = right.size (); i--;)
-       {
-         if (dynamic_cast<Item *> (right[i])->get_column () != mincol)
-           right.erase (right.begin () + i);
-       }
-    }
-
   return mincol;
 }
 
@@ -228,8 +211,10 @@ Spacing_interface::extremal_break_aligned_grob (Grob *me,
 
 
 ADD_INTERFACE (Spacing_interface,
-              "This object calculates the desired and minimum distances between two columns.",
+              "This object calculates the desired and minimum distances"
+              " between two columns.",
 
+              /* properties */
               "left-items "
               "right-items "
               );