Permalink
Browse files

Fix for issue 110. update-at! only applied last change in args.

  • Loading branch information...
1 parent 7dc2a5d commit 0ffe6f9ecc9ffd7919171a6f956fac7becc6123c @daveray committed Dec 14, 2012
Showing with 6 additions and 5 deletions.
  1. +4 −3 src/seesaw/table.clj
  2. +2 −2 test/seesaw/test/table.clj
View
@@ -211,6 +211,7 @@
http://download.oracle.com/javase/6/docs/api/javax/swing/table/TableModel.html
"
([target row value]
+ (println row "/" value)
(let [target (to-table-model target)
col-key-map (get-column-key-map target)
^objects row-values (unpack-row col-key-map value)]
@@ -224,9 +225,9 @@
(last row-values)) row -1))
target)
([target row value & more]
- (if more
- (apply update-at! target more)
- (update-at! target row value))))
+ (when more
+ (apply update-at! target more))
+ (update-at! target row value)))
(defn insert-at!
"Inserts one or more rows into a table. The arguments are one or more row-index/value
@@ -107,8 +107,8 @@
(let [t (table-model :columns [:a :b] :rows [["a0" "b0"] ["a1" "b1"]])
r (update-at! t 1 ["A1" "B1"] 0 {:a "A0" :b "B0"})]
(expect (= t r))
- (expect (= {:a "A0" :b "B0"} (value-at t 0))))
- (expect (= {:a "A1" :b "B1"} (value-at t 1)))))
+ (expect (= {:a "A0" :b "B0"} (value-at t 0)))
+ (expect (= {:a "A1" :b "B1"} (value-at t 1))))))
(describe insert-at!
(it "inserts a row with the same format as :rows option of (table-model)"

0 comments on commit 0ffe6f9

Please sign in to comment.