summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/worksheet/worksheet.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb
index 211d1c88..f84e9b92 100644
--- a/lib/axlsx/workbook/worksheet/worksheet.rb
+++ b/lib/axlsx/workbook/worksheet/worksheet.rb
@@ -351,7 +351,8 @@ module Axlsx
cells.each_with_index do |item, index|
col = @auto_fit_data[index] ||= {:longest=>"", :sz=>sz, :fixed=>nil}
width = widths[index]
- col[:fixed] = width if [Integer, Float, Fixnum, NilClass].include? width.class
+ # set fixed width and skip if numeric width is given
+ col[:fixed] = width and next if [Integer, Float, Fixnum].include?(width.class)
# ignore default column widths and formula
next if width == :ignore || (item.value.is_a?(String) && item.value.start_with?('='))
@@ -362,7 +363,6 @@ module Axlsx
col[:sz] = sz
col[:longest] = item.value.to_s
end
- @auto_fit_data[index] = col
end
cells
end