lib/roo/openoffice.rb in roo-0.2.4 vs lib/roo/openoffice.rb in roo-0.2.5
- old
+ new
@@ -124,17 +124,23 @@
# returns all values in this row as an array
# row numbers are 1,2,3,... like in the spreadsheet
def row(rownumber)
read_cells unless @cells_read
result = []
+ tmp_arr = []
@cell.each_pair {|key,value|
+
y,x = key.split(',')
x = x.to_i
y = y.to_i
if y == rownumber
- result[x-1,rownumber] = value
+ tmp_arr[x] = value
end
}
+ result = tmp_arr[1..-1]
+ while result[-1] == nil
+ result = result[0..-2]
+ end
result
end
# returns the number of the last non-empty row
def last_row