]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-svg.scm
Check for a null string before using `placebox'
[lilypond.git] / scm / output-svg.scm
index 784003458d5d335305d7fca9dad897e2281fa3e3..e99711f9c6e054ee99accb86a0cad5e4cf50983f 100644 (file)
 ;;; stencil outputters
 ;;;
 
-;;; catch-all for missing stuff
-;;; comment this out to see find out what functions you miss :-)
-
-(if #f
-    (begin
-      (define (dummy . foo) "")
-      (map (lambda (x) (module-define! this-module x dummy))
-          (append
-           (ly:all-stencil-expressions)
-           (ly:all-output-backend-commands)))
-      ))
 
 (define (url-link url x y)
   (string-append
                             (ly:font-glyph-name-to-charcode font name))))))
 
 (define (placebox x y expr)
-  (let*
-    ((match (regexp-exec svg-element-regexp expr))
-     (tagname (match:substring match 1))
-     (attributes (match:substring match 2)))
-
-    (string-append tagname
-                  ;; FIXME: Not using GNU coding standards
-                  ;; [translate ()] here to work around a
-                  ;; bug in Microsoft Internet Explorer 6.0
-                  (ly:format " transform=\"translate(~f, ~f)\" " x (- y))
-                  attributes
-                  "\n")))
+  (if (not (string-null? expr))
+      (let*
+       ((match (regexp-exec svg-element-regexp expr))
+        (tagname (match:substring match 1))
+        (attributes (match:substring match 2)))
+
+       (string-append tagname
+                      ;; FIXME: Not using GNU coding standards
+                      ;; [translate ()] here to work around a
+                      ;; bug in Microsoft Internet Explorer 6.0
+                      (ly:format " transform=\"translate(~f, ~f)\" "
+                                 x (- y))
+                      attributes
+                      "\n"))
+      ""))
 
 (define (polygon coords blot-diameter is-filled)
   (entity