summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinhold Kainhofer <reinhold@kainhofer.com>2011-04-15 18:31:17 +0200
committerReinhold Kainhofer <reinhold@kainhofer.com>2011-04-15 18:31:17 +0200
commit98b9439fda0b019a67cfe63b0c0c5bb99ded618e (patch)
tree8c0c4ab55c6ad66f5556eed494f86fa48e193121
parent3d571d9c80b7855422c96ecc6966bcbfa4dfb9ff (diff)
Fix TOC: don't add links to non-existing labels in the .ps file
-rw-r--r--input/regression/page-links-nolabel.ly11
-rw-r--r--scm/output-ps.scm14
2 files changed, 19 insertions, 6 deletions
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)