lib/roo/openoffice.rb in roo-0.2.5 vs lib/roo/openoffice.rb in roo-0.2.6
- old
+ new
@@ -285,23 +285,33 @@
# p tr
if tr.name == 'table-cell'
skip = tr.attributes['number-columns-repeated']
vt = tr.attributes['value-type']
v = tr.attributes['value']
+ if vt == 'string'
+ tr.each_element do |str|
+ if str.name == 'p'
+ v = str.text
+ end
+ end
+ end
if skip
if v == nil
x += (skip.to_i - 1)
else
0.upto(skip.to_i-1) do |i|
@cell_type["#{y},#{x+i}"] = vt
if @cell_type["#{y},#{x+i}"] == 'float'
@cell["#{y},#{x+i}"] = v.to_f
elsif @cell_type["#{y},#{x+i}"] == 'string'
- tr.each_element do |str|
- if str.name == 'p'
- @cell["#{y},#{x+i}"] = str.text
- end
- end
+ # puts "in string zweig..."
+ #tr.each_element do |str|
+ # if str.name == 'p'
+ # @cell["#{y},#{x+i}"] = str.text
+ # end
+ #end
+ @cell["#{y},#{x+i}"] = v
+
elsif @cell_type["#{y},#{x+i}"] == 'date'
@cell["#{y},#{x+i}"] = tr.attributes['date-value']
else
@cell["#{y},#{x+i}"] = v
end