lib/write_xlsx/workbook.rb in write_xlsx-1.01.0 vs lib/write_xlsx/workbook.rb in write_xlsx-1.02.0

- old
+ new

@@ -47,10 +47,11 @@ attr_reader :custom_properties # :nodoc: attr_reader :image_types, :images # :nodoc: attr_reader :shared_strings # :nodoc: attr_reader :vba_project # :nodoc: attr_reader :excel2003_style # :nodoc: + attr_reader :max_url_length # :nodoc: attr_reader :strings_to_urls # :nodoc: attr_reader :default_url_format # :nodoc: # # A new Excel workbook is created using the +new+ constructor @@ -128,10 +129,16 @@ @table_count = 0 @image_types = {} @images = [] @strings_to_urls = (options[:strings_to_urls].nil? || options[:strings_to_urls]) ? true : false + @max_url_length = 2079 + if options[:max_url_length] + @max_url_length = options[:max_url_length] + + @max_url_length = 2079 if @max_url_length < 250 + end # Structures for the shared strings data. @shared_strings = Package::SharedStrings.new # Formula calculation default settings. @calc_id = 124519 @@ -1933,20 +1940,20 @@ if chart_count + image_count + shape_count > 0 drawing_id += 1 has_drawings = true end - # Prepare the worksheet charts. - sheet.charts.each_with_index do |chart, index| - chart_ref_id += 1 - sheet.prepare_chart(index, chart_ref_id, drawing_id) - end - # Prepare the worksheet images. sheet.images.each_with_index do |image, index| type, width, height, name, x_dpi, y_dpi = get_image_properties(image[2]) image_ref_id += 1 sheet.prepare_image(index, image_ref_id, drawing_id, width, height, name, type, x_dpi, y_dpi) + end + + # Prepare the worksheet charts. + sheet.charts.each_with_index do |chart, index| + chart_ref_id += 1 + sheet.prepare_chart(index, chart_ref_id, drawing_id) end # Prepare the worksheet shapes. sheet.shapes.each_with_index do |shape, index| sheet.prepare_shape(index, drawing_id)