]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/paper-book.cc
T405 - Respect setting bracket-visibility property.
[lilypond.git] / lily / paper-book.cc
index 79896e6da1d52e7c1a7cffd0a9399d4e65f7c69b..33998a190b84183e566342b8dc861f2b5fdf5180 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2004--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+  Copyright (C) 2004--2010 Jan Nieuwenhuizen <janneke@gnu.org>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -516,15 +516,20 @@ Paper_book::get_system_specs ()
                                  paper_->self_scm (),
                                  page_properties,
                                  scm_car (s));
-         for (SCM list = texts ; scm_is_pair (list) ; list = scm_cdr (list))
+         Prob *ps;
+         SCM list;
+         for (list = texts ; scm_is_pair (list) ; list = scm_cdr (list))
            {
              SCM t = scm_car (list);
              // TODO: init props
-             Prob *ps = make_paper_system (SCM_EOL);
+             ps = make_paper_system (SCM_EOL);
              ps->set_property ("page-break-permission",
                                ly_symbol2scm ("allow"));
              ps->set_property ("page-turn-permission",
                                ly_symbol2scm ("allow"));
+             ps->set_property ("last-markup-line",  SCM_BOOL_F);
+             ps->set_property ("first-markup-line",
+                         list == texts? SCM_BOOL_T : SCM_BOOL_F);
 
              paper_system_set_stencil (ps, *unsmob_stencil (t));
              ps->set_property ("is-title", SCM_BOOL_T);
@@ -544,6 +549,18 @@ Paper_book::get_system_specs ()
              // FIXME: figure out penalty.
              //set_system_penalty (ps, scores_[i].header_);
            }
+         // We may want to place a check here, for whether the line is too short
+         if (list == texts)
+           {
+             // if there is only one line in the paragraph,
+             // do not try to avoid orphans
+             ps->set_property ("last-markup-line", SCM_BOOL_F);
+             ps->set_property ("first-markup-line", SCM_BOOL_F);
+           }
+         else
+           {
+             ps->set_property ("last-markup-line", SCM_BOOL_T);
+           }
        }
       else
        assert (0);