summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-02-16 18:23:21 +0900
committerRandy Morgan <[email protected]>2012-02-16 18:23:21 +0900
commitfb198aaef459ebad45f8deed84efbb3e92c340ce (patch)
tree4565dce37f9381f98dc1331d03e7140c1e9ceb9d /lib
parent0c9615a7d5e936e0927452dbb6a46e414dc3675b (diff)
parent3eded043ca584914c575dde362d7fecccf905cc7 (diff)
downloadcaxlsx-fb198aaef459ebad45f8deed84efbb3e92c340ce.tar.gz
caxlsx-fb198aaef459ebad45f8deed84efbb3e92c340ce.zip
Merge https://github.com/randym/axlsx
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