From 46624b4fa190e1bc7265494ff2f4b9990f577830 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 Sep 2012 13:54:59 -0400 Subject: [PATCH] * lisp/doc-view.el (doc-view-guess-paper-size) (doc-view-scale-bounding-box): Fix unbound `caddr'. --- lisp/ChangeLog | 5 +++++ lisp/doc-view.el | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6dbe14f8776..8d90c818d22 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-19 Stefan Monnier + + * doc-view.el (doc-view-guess-paper-size) + (doc-view-scale-bounding-box): Fix unbound `caddr'. + 2012-09-19 Tassilo Horn New feature: set optimal slice from BoundingBox information. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 9c53a4a982e..65bf26e5eca 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1068,15 +1068,15 @@ dragging it to its bottom-right corner. See also (round (/ (* 100.0 x) y)))) (let ((ar (div iw ih)) (al (mapcar (lambda (l) - (list (div (cadr l) (caddr l)) (car l))) + (list (div (nth 1 l) (nth 2 l)) (car l))) doc-view-paper-sizes))) (cadr (assoc ar al))))) (defun doc-view-scale-bounding-box (ps iw ih bb) - (list (/ (* (nth 0 bb) iw) (cadr (assoc ps doc-view-paper-sizes))) - (/ (* (nth 1 bb) ih) (caddr (assoc ps doc-view-paper-sizes))) - (/ (* (nth 2 bb) iw) (cadr (assoc ps doc-view-paper-sizes))) - (/ (* (nth 3 bb) ih) (caddr (assoc ps doc-view-paper-sizes))))) + (list (/ (* (nth 0 bb) iw) (nth 1 (assoc ps doc-view-paper-sizes))) + (/ (* (nth 1 bb) ih) (nth 2 (assoc ps doc-view-paper-sizes))) + (/ (* (nth 2 bb) iw) (nth 1 (assoc ps doc-view-paper-sizes))) + (/ (* (nth 3 bb) ih) (nth 2 (assoc ps doc-view-paper-sizes))))) (defun doc-view-set-slice-from-bounding-box (&optional force-paper-size) "Set the slice from the document's BoundingBox information.