Browse Source

org-table.el: Fix bug about handling remote references as durations.

* org-table.el (org-table-eval-formula): Fix bug about
handling remote references as durations.

Thanks to Sébastien Vauban for reporting this.
Bastien Guerry 13 years ago
parent
commit
7d8c5c66e9
1 changed files with 7 additions and 2 deletions
  1. 7 2
      lisp/org-table.el

+ 7 - 2
lisp/org-table.el

@@ -2526,8 +2526,13 @@ not overwrite the stored one."
 		(replace-match
 		 (save-match-data
 		   (org-table-make-reference
-		    (org-table-get-remote-range
-		     (match-string 1 form) (match-string 2 form))
+		    (let ((rmtrng (org-table-get-remote-range
+				   (match-string 1 form) (match-string 2 form))))
+		      (if duration
+			  (if (listp rmtrng)
+			      (mapcar (lambda(x) (org-table-time-string-to-seconds x)) rmtrng)
+			    (org-table-time-string-to-seconds rmtrng))
+			rmtrng))
 		    keep-empty numbers lispp))
 		 t t form)))
 	;; Insert complex ranges