diff options
author | Teddy Wing | 2023-04-21 20:02:21 +0200 |
---|---|---|
committer | Teddy Wing | 2023-04-21 20:02:21 +0200 |
commit | 20b928e0874fc8da727e5b9e635b03719e91e8c8 (patch) | |
tree | e202c1dffdf494deaecd0b21c9927b3a47534994 /src | |
parent | b23923c159c057090019c05c36ccc3b6a4608fd6 (diff) | |
download | xfdf-20b928e0874fc8da727e5b9e635b03719e91e8c8.tar.bz2 |
xfdf.lisp: Extract wrapper field printing code to function
Diffstat (limited to 'src')
-rw-r--r-- | src/xfdf.lisp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/xfdf.lisp b/src/xfdf.lisp index 98516a3..726b578 100644 --- a/src/xfdf.lisp +++ b/src/xfdf.lisp @@ -52,16 +52,7 @@ list." (rest field) field))) (field-xfdf* subname subfield (1+ nesting-level)))))) - (format nil "~ -~v{~A~:*~}<field name=\"~A\"> -~{~A~}~v{~A~:*~}</field> -" -indent -'(" ") -name -inner-fields -indent -'(" "))) + (build-xfdf-outer-field name inner-fields indent)) ;; TODO: Put checkbox stuff here. (let ((value (pdf-checkbox-value value))) @@ -78,6 +69,19 @@ If `value` is anything else, return its identity." ((eq value nil) "Off") (t value))) +(defun build-xfdf-outer-field (name inner-fields-str indent) + "Build the XFDF XML for a field containing other fields." + (format nil "~ +~v{~A~:*~}<field name=\"~A\"> +~{~A~}~v{~A~:*~}</field> +" +indent +'(" ") +name +inner-fields-str +indent +'(" "))) + (defun build-xfdf-field (name value indent) (format nil "~ ~v{~A~:*~}<field name=\"~A\"> |