]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/page-turn-page-breaking.cc
Web-es: add missing '@end ifset'
[lilypond.git] / lily / page-turn-page-breaking.cc
index d2e501cb65d034bcb8c63a52aa6e0418bf19c3c9..c9029cf7b53e649fde6ff4455b468976b9c9117c 100644 (file)
@@ -1,9 +1,20 @@
 /*
-  page-turn-page-breaking.cc -- implement Page_turn_page_breaking
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
+  Copyright (C) 2006--2009 Joe Neeman <joeneeman@gmail.com>
 
-  (c) 2006--2007 Joe Neeman <joeneeman@gmail.com>
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "page-turn-page-breaking.hh"
 static bool
 is_break (Grob *g)
 {
-  return scm_is_symbol (g->get_property ("page-turn-permission"));
+  bool turnable = scm_is_symbol (g->get_property ("page-turn-permission"));
+
+  if (turnable &&
+      (!scm_is_symbol (g->get_property ("page-break-permission"))
+       || !scm_is_symbol (g->get_property ("line-break-permission"))))
+    {
+      programming_error ("found a page-turnable place which was not breakable");
+      turnable = false;
+    }
+
+  return turnable;
 }
 
 Page_turn_page_breaking::Page_turn_page_breaking (Paper_book *pb)
@@ -122,7 +143,7 @@ Page_turn_page_breaking::calc_subproblem (vsize ending_breakpoint)
       if (start > 0 && best.demerits_ < state_[start-1].demerits_)
         continue;
 
-      int p_num = robust_scm2int (book_->paper_->c_variable ("part-first-page-number"), 1);
+      int p_num = robust_scm2int (book_->paper_->c_variable ("first-page-number"), 1);
       if (start > 0)
         {
          /* except possibly for the first page, enforce the fact that first_page_number_
@@ -260,7 +281,7 @@ Page_turn_page_breaking::make_pages (vector<Break_node> const &soln, SCM systems
 
   /* this should only actually modify first-page-number if
      auto-first-page-number was true. */
-  book_->paper_->set_variable (ly_symbol2scm ("part-first-page-number"),
+  book_->paper_->set_variable (ly_symbol2scm ("first-page-number"),
                               scm_from_int (soln[0].first_page_number_));
   return Page_breaking::make_pages (lines_per_page, systems);
 }