diff options
| author | Teddy Wing | 2023-04-21 19:30:01 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2023-04-21 19:30:01 +0200 | 
| commit | 39b5831e74f75c4e21238e044c3b46f8180dcb73 (patch) | |
| tree | 7ae33b219533a1dcd848ea5b010ed631ccf180d9 /src | |
| parent | b353ac4dab798c6b5b70afa5da5101f3365a8985 (diff) | |
| download | xfdf-39b5831e74f75c4e21238e044c3b46f8180dcb73.tar.bz2 | |
xfdf.lisp: Extract checkbox default value modification to function
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfdf.lisp | 14 | 
1 files changed, 11 insertions, 3 deletions
| diff --git a/src/xfdf.lisp b/src/xfdf.lisp index 3e4effb..112b263 100644 --- a/src/xfdf.lisp +++ b/src/xfdf.lisp @@ -64,9 +64,7 @@ indent  '("	")))          ;; TODO: Put checkbox stuff here. -        (let ((value (cond ((eq value t) "Yes") -                           ((eq value nil) "Off") -                           (t value)))) +        (let ((value (pdf-checkbox-value value)))            (format nil "~  ~v{~A~:*~}<field name=\"~A\">  ~v{~A~:*~}	<value>~A</value> @@ -81,3 +79,13 @@ value  indent  '("	"))))))  ;; * (format t "~v{~A~:*~}<>~A" 5 '("Hello") "Next") + +(defun pdf-checkbox-value (value) +  "If `value` is T or NIL, convert it to the default PDF checkbox values +'Yes' and 'Off' respectively. + +If `value` is anything else, return its identity." + +  (cond ((eq value t) "Yes") +        ((eq value nil) "Off") +        (t value))) | 
