[go: up one dir, main page]

Skip to content

Commit

Permalink
SB -- Dealing with nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
wantmys2000 committed Jul 29, 2014
1 parent fcafce5 commit b6fce71
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/dullard/reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def rows
row = nil
column = nil
cell_type = nil
closed = true
Nokogiri::XML::Reader(@file).each do |node|
case node.node_type
when Nokogiri::XML::Reader::TYPE_ELEMENT
Expand All @@ -201,6 +202,9 @@ def rows
column = 0
next
when "c"
row << "" unless closed
closed = false

if node.attributes['t'] != 's' && node.attributes['t'] != 'b'
cell_format_index = node.attributes['s'].to_i
cell_type = @workbook.format2type(@workbook.attribute2format(cell_format_index))
Expand All @@ -220,6 +224,8 @@ def rows
end
when Nokogiri::XML::Reader::TYPE_END_ELEMENT
if node.name == "row"
row << "" unless closed
closed = true
y << row
next
end
Expand Down

0 comments on commit b6fce71

Please sign in to comment.