diff options
| author | Randy Morgan <[email protected]> | 2012-02-16 01:09:53 -0800 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-02-16 01:09:53 -0800 |
| commit | 3eded043ca584914c575dde362d7fecccf905cc7 (patch) | |
| tree | 420947b4eafae5e5a0ce3c57774f992bc10e1f81 /lib | |
| parent | cd890f6c5a84f6b5c5458f4c6edeab9103bf1cee (diff) | |
| parent | 8f65949ba1012382d9151c179255a60423d2be5a (diff) | |
| download | caxlsx-3eded043ca584914c575dde362d7fecccf905cc7.tar.gz caxlsx-3eded043ca584914c575dde362d7fecccf905cc7.zip | |
Merge pull request #28 from ochko/master
Next iteration after setting fixed width
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/worksheet.rb | 4 |
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 |
