lib/write_xlsx/worksheet.rb in write_xlsx-1.11.0 vs lib/write_xlsx/worksheet.rb in write_xlsx-1.11.1
- old
+ new
@@ -21,10 +21,11 @@
class Worksheet
include Writexlsx::Utility
MAX_DIGIT_WIDTH = 7 # For Calabri 11. # :nodoc:
PADDING = 5 # :nodoc:
+ COLINFO = Struct.new('ColInfo', :width, :format, :hidden, :level, :collapsed, :autofit)
attr_reader :index # :nodoc:
attr_reader :charts, :images, :tables, :shapes, :drawings # :nodoc:
attr_reader :header_images, :footer_images, :background_image # :nodoc:
attr_reader :vml_drawing_links # :nodoc:
@@ -355,12 +356,11 @@
@outline_col_level = level if level > @outline_col_level
# Store the column data based on the first column. Padded for sorting.
(firstcol..lastcol).each do |col|
@col_info[col] =
- Struct.new('ColInfo', :width, :format, :hidden, :level, :collapsed, :autofit)
- .new(width, format, hidden, level, collapsed, autofit)
+ COLINFO.new(width, format, hidden, level, collapsed, autofit)
end
# Store the column change to allow optimisations.
@col_size_changed = 1
end
@@ -495,11 +495,10 @@
if @col_info[col_num]
@col_info[col_num].width = width
@col_info[col_num].autofit = 1
else
@col_info[col_num] =
- Struct.new('ColInfo', :width, :format, :hidden, :level, :collapsed, :autofit)
- .new(width, nil, 0, 0, 0, 1)
+ COLINFO.new(width, nil, 0, 0, 0, 1)
end
end
end
#