Browse files

Debug statement

  • Loading branch information...
1 parent 8baa5d9 commit a84d6b4981bdc2281a6a22b8a2c323640c2f7f99 @mattolson committed Mar 6, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/rubyXL/parser.rb
View
7 lib/rubyXL/parser.rb
@@ -233,8 +233,6 @@ def self.parse_shared_strings(wb, filename)
inside_element do
inside_element 'si' do
inside_element 't' do
- puts "Found sst > si > t: #{inner_xml}" if @@debug
-
if value?
str = value
wb.shared_strings[i] = str
@@ -326,14 +324,15 @@ def self.parse_worksheet(wb, filename)
unless v.nil?
# Get cell data and coerce type
if data_type == 's' # shared string
- cell_data = worksheet.workbook.shared_strings[Integer(v.content)]
+ cell_data = wb.shared_strings[Integer(v.content)]
+ puts "Using shared string: wb.shared_strings[#{Integer(v.content)}] = #{cell_data} for cell [#{cell_index[0]}][#{cell_index[1]}]" if @@debug
elsif data_type == 'str' # raw string
cell_data = v.content
elsif data_type == 'e' # error
cell_data = v.content
elsif !v.content.nil? && v.content != ''
data_type = ''
- if value =~ /\./ #is float
+ if v.content =~ /\./ #is float
cell_data = Float(v.content)
else
cell_data = Integer(v.content)

0 comments on commit a84d6b4

Please sign in to comment.