From: Reinhold Kainhofer Date: Fri, 15 Apr 2011 16:31:17 +0000 (+0200) Subject: Fix TOC: don't add links to non-existing labels in the .ps file X-Git-Tag: release/2.13.60-1~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=98b9439fda0b019a67cfe63b0c0c5bb99ded618e;p=lilypond.git Fix TOC: don't add links to non-existing labels in the .ps file --- 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)