]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/break-alignment-interface.cc
Merge branch 'issue4032'
[lilypond.git] / lily / break-alignment-interface.cc
index a471a7ba9fab543184b0108fe5e05abd23b0a03c..76d1e48ca4c7ee88d1bc7baf8c4a21415f49320c 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2014 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
@@ -26,7 +26,6 @@
 #include "output-def.hh"
 #include "paper-column.hh"
 #include "pointer-group-interface.hh"
-#include "self-alignment-interface.hh"
 #include "side-position-interface.hh"
 #include "warn.hh"
 
@@ -95,7 +94,7 @@ MAKE_SCHEME_CALLBACK (Break_alignment_interface, calc_positioning_done, 1)
 SCM
 Break_alignment_interface::calc_positioning_done (SCM smob)
 {
-  Grob *grob = unsmob_grob (smob);
+  Grob *grob = Grob::unsmob (smob);
   Item *me = dynamic_cast<Item *> (grob);
 
   me->set_property ("positioning-done", SCM_BOOL_T);
@@ -103,13 +102,10 @@ Break_alignment_interface::calc_positioning_done (SCM smob)
   vector<Grob *> elems = ordered_elements (me);
   vector<Interval> extents;
 
-  int last_nonempty = -1;
   for (vsize i = 0; i < elems.size (); i++)
     {
       Interval y = elems[i]->extent (elems[i], X_AXIS);
       extents.push_back (y);
-      if (!y.is_empty ())
-        last_nonempty = i;
     }
 
   vsize idx = 0;
@@ -193,12 +189,12 @@ Break_alignment_interface::calc_positioning_done (SCM smob)
             sym_string = ly_symbol2string (rsym);
 
           string orig_string;
-          if (unsmob_grob (l->get_property ("cause")))
-            orig_string = unsmob_grob (l->get_property ("cause"))->name ();
+          if (Grob::unsmob (l->get_property ("cause")))
+            orig_string = Grob::unsmob (l->get_property ("cause"))->name ();
 
-          programming_error (_f ("No spacing entry from %s to `%s'",
-                                 orig_string.c_str (),
-                                 sym_string.c_str ()));
+          programming_error (to_string ("No spacing entry from %s to `%s'",
+                                        orig_string.c_str (),
+                                        sym_string.c_str ()));
         }
 
       Real distance = 1.0;
@@ -265,7 +261,7 @@ MAKE_SCHEME_CALLBACK (Break_alignable_interface, self_align_callback, 1)
 SCM
 Break_alignable_interface::self_align_callback (SCM grob)
 {
-  Grob *me = unsmob_grob (grob);
+  Grob *me = Grob::unsmob (grob);
   Item *alignment = dynamic_cast<Item *> (me->get_parent (X_AXIS));
   if (!Break_alignment_interface::has_interface (alignment))
     return scm_from_int (0);
@@ -312,7 +308,7 @@ MAKE_SCHEME_CALLBACK (Break_aligned_interface, calc_average_anchor, 1)
 SCM
 Break_aligned_interface::calc_average_anchor (SCM grob)
 {
-  Grob *me = unsmob_grob (grob);
+  Grob *me = Grob::unsmob (grob);
   Real avg = 0.0;
   int count = 0;
 
@@ -335,7 +331,7 @@ MAKE_SCHEME_CALLBACK (Break_aligned_interface, calc_extent_aligned_anchor, 1)
 SCM
 Break_aligned_interface::calc_extent_aligned_anchor (SCM smob)
 {
-  Grob *me = unsmob_grob (smob);
+  Grob *me = Grob::unsmob (smob);
   Real alignment = robust_scm2double (me->get_property ("break-align-anchor-alignment"), 0.0);
   Interval iv = me->extent (me, X_AXIS);
 
@@ -350,7 +346,7 @@ SCM
 Break_aligned_interface::calc_break_visibility (SCM smob)
 {
   /* a BreakAlignGroup is break-visible if it has one element that is break-visible */
-  Grob *me = unsmob_grob (smob);
+  Grob *me = Grob::unsmob (smob);
   SCM ret = scm_c_make_vector (3, SCM_EOL);
   extract_grob_set (me, "elements", elts);
   for (int dir = 0; dir <= 2; dir++)