From 98b9439fda0b019a67cfe63b0c0c5bb99ded618e Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Fri, 15 Apr 2011 18:31:17 +0200 Subject: [PATCH] Fix TOC: don't add links to non-existing labels in the .ps file --- input/regression/page-links-nolabel.ly | 11 +++++++++++ scm/output-ps.scm | 14 ++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 input/regression/page-links-nolabel.ly diff --git a/input/regression/page-links-nolabel.ly b/input/regression/page-links-nolabel.ly new file mode 100644 index 0000000000..a8a1212350 --- /dev/null +++ b/input/regression/page-links-nolabel.ly @@ -0,0 +1,11 @@ +\version "2.13.60" + +\header { + + texidoc = "Links to labels should not break if the label doesn't exist." + +} + +\book { + \markup { \with-link #'dummy \concat { "Link to non-existing label" } } +} \ No newline at end of file diff --git a/scm/output-ps.scm b/scm/output-ps.scm index d1c0c419ed..c83b613cbd 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -262,12 +262,14 @@ url)) (define (page-link page-no x y) - (ly:format "~a ~a currentpoint vector_add ~a ~a currentpoint vector_add ~a mark_page_link" - (car x) - (car y) - (cdr x) - (cdr y) - page-no)) + (if (number? page-no) + (ly:format "~a ~a currentpoint vector_add ~a ~a currentpoint vector_add ~a mark_page_link" + (car x) + (car y) + (cdr x) + (cdr y) + page-no) + "")) (define* (path thickness exps #:optional (cap 'round) (join 'round) (fill? #f)) (define (convert-path-exps exps) -- 2.39.2