]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix TOC: don't add links to non-existing labels in the .ps file
authorReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 15 Apr 2011 16:31:17 +0000 (18:31 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 15 Apr 2011 16:31:17 +0000 (18:31 +0200)
input/regression/page-links-nolabel.ly [new file with mode: 0644]
scm/output-ps.scm

diff --git a/input/regression/page-links-nolabel.ly b/input/regression/page-links-nolabel.ly
new file mode 100644 (file)
index 0000000..a8a1212
--- /dev/null
@@ -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
index d1c0c419ed427f75b8e263b147e68ee015ad5d14..c83b613cbd1ceca68b2157886cb05fb0b5bfa393 100644 (file)
             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)