]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/item.cc
Doc: mention page-count in "fitting music onto fewer pages"
[lilypond.git] / lily / item.cc
index bf67f3c6dda4d578255a7a3f211c6e28d54c66c1..6ea5643a5445e7d791a119479e73d54a5fe7aead 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--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
@@ -55,9 +55,6 @@ Item::Item (Item const &s)
 bool
 Item::is_non_musical (Grob *me)
 {
-  if (me->original ())
-    return false;
-
   Item *i = dynamic_cast<Item *> (me->get_parent (X_AXIS));
   return i ? Item::is_non_musical (i) : to_boolean (me->get_property ("non-musical"));
 }
@@ -105,7 +102,7 @@ Item::is_broken () const
 void
 Item::discretionary_processing ()
 {
-  if (is_broken ())
+  if (is_broken () || original ())
     return;
 
   if (Item::is_non_musical (this))
@@ -245,11 +242,17 @@ Item::pure_height (Grob *g, int start, int end)
   if (cached_pure_height_valid_)
     return cached_pure_height_ + pure_relative_y_coordinate (g, start, end);
 
-  cached_pure_height_ = Grob::pure_height (this, start, end);
-  cached_pure_height_valid_ = true;
+  cache_pure_height (Grob::pure_height (this, start, end));
   return cached_pure_height_ + pure_relative_y_coordinate (g, start, end);
 }
 
+void
+Item::cache_pure_height (Interval height)
+{
+  cached_pure_height_ = height;
+  cached_pure_height_valid_ = true;
+}
+
 ADD_INTERFACE (Item,
                "Grobs can be distinguished in their role in the horizontal"
                " spacing.  Many grobs define constraints on the spacing by"