]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/break-substitution.cc
Run grand replace for 2015.
[lilypond.git] / lily / break-substitution.cc
index 74314b39c03f71961b00fecddb41759ad6386667..c2a363cb7366a1da5b9c2b4f1fe71a72795a5503 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2001--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2001--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
@@ -51,7 +51,7 @@ substitute_grob (Grob *sc)
   else
     {
       System *line
-        = dynamic_cast<System *> (unsmob_grob (break_criterion));
+        = dynamic_cast<System *> (Grob::unsmob (break_criterion));
       if (sc->get_system () != line)
         sc = sc->find_broken_piece (line);
 
@@ -101,9 +101,9 @@ do_break_substitution (SCM src)
 {
 again:
 
-  if (unsmob_grob (src))
+  if (Grob::is_smob (src))
     {
-      Grob *new_ptr = substitute_grob (unsmob_grob (src));
+      Grob *new_ptr = substitute_grob (Grob::unsmob (src));
       return new_ptr ? new_ptr->self_scm () : SCM_UNDEFINED;
     }
   else if (scm_is_vector (src))
@@ -248,14 +248,12 @@ item_system_range (Item *it)
     return Slice (st->get_rank (), st->get_rank ());
 
   Slice sr;
-  Direction d = LEFT;
-  do
+  for (LEFT_and_RIGHT (d))
     {
       Item *bi = it->find_prebroken_piece (d);
       if (bi && bi->get_system ())
         sr.add_point (bi->get_system ()->get_rank ());
     }
-  while (flip (&d) != LEFT);
 
   return sr;
 }
@@ -410,13 +408,13 @@ Spanner::fast_substitute_grob_array (SCM sym,
       set_break_subsititution (l ? l->self_scm () : SCM_UNDEFINED);
 
       SCM newval = sc->internal_get_object (sym);
-      if (!unsmob_grob_array (newval))
+      if (!Grob_array::is_smob (newval))
         {
           newval = Grob_array::make_array ();
           sc->set_object (sym, newval);
         }
 
-      Grob_array *new_array = unsmob_grob_array (newval);
+      Grob_array *new_array = Grob_array::unsmob (newval);
       for (int k = 0; k < 2; k++)
         for (int j = (*arrs[k])[i][LEFT]; j <= (*arrs[k])[i][RIGHT]; j++)
           {
@@ -463,7 +461,7 @@ substitute_object_alist (SCM alist, SCM dest)
       SCM sym = scm_caar (s);
       SCM val = scm_cdar (s);
 
-      if (Grob_array *orig = unsmob_grob_array (val))
+      if (Grob_array *orig = Grob_array::unsmob (val))
         {
           SCM handle = scm_assq (sym, dest);
           SCM newval
@@ -471,7 +469,7 @@ substitute_object_alist (SCM alist, SCM dest)
               ? scm_cdr (handle)
               : Grob_array::make_array ();
 
-          Grob_array *new_arr = unsmob_grob_array (newval);
+          Grob_array *new_arr = Grob_array::unsmob (newval);
 
           substitute_grob_array (orig, new_arr);
           val = newval;
@@ -499,7 +497,7 @@ Spanner::substitute_one_mutable_property (SCM sym,
   Spanner *s = this;
 
   bool fast_done = false;
-  Grob_array *grob_array = unsmob_grob_array (val);
+  Grob_array *grob_array = Grob_array::unsmob (val);
   if (grob_array)
     fast_done = s->fast_substitute_grob_array (sym, grob_array);
 
@@ -513,12 +511,12 @@ Spanner::substitute_one_mutable_property (SCM sym,
         if (grob_array)
           {
             SCM newval = sc->internal_get_object (sym);
-            if (!unsmob_grob_array (newval))
+            if (!Grob_array::is_smob (newval))
               {
                 newval = Grob_array::make_array ();
                 sc->set_object (sym, newval);
               }
-            substitute_grob_array (grob_array, unsmob_grob_array (newval));
+            substitute_grob_array (grob_array, Grob_array::unsmob (newval));
           }
         else
           {