# File lib/spreadsheet/excel/writer/workbook.rb, line 51 def collect_formats workbook, opts={} # The default cell format is always present in an Excel file, described by # the XF record with the fixed index 15 (0-based). By default, it uses the # worksheet/workbook default cell style, described by the very first XF # record (index 0). formats = [] unless opts[:existing_document] 15.times do formats.push Format.new(self, workbook, workbook.default_format, :type => :style) end formats.push Format.new(self, workbook) end workbook.formats.each do |fmt| formats.push Format.new(self, workbook, fmt) end formats.each_with_index do |fmt, idx| fmt.xf_index = idx end @formats[workbook] = formats end