lib/axlsx/workbook/workbook.rb in axlsx-1.1.4 vs lib/axlsx/workbook/workbook.rb in axlsx-1.1.5
- old
+ new
@@ -2,18 +2,22 @@
module Axlsx
require 'axlsx/workbook/worksheet/date_time_converter.rb'
require 'axlsx/workbook/worksheet/cell.rb'
require 'axlsx/workbook/worksheet/page_margins.rb'
+require 'axlsx/workbook/worksheet/page_setup.rb'
+require 'axlsx/workbook/worksheet/print_options.rb'
require 'axlsx/workbook/worksheet/cfvo.rb'
require 'axlsx/workbook/worksheet/color_scale.rb'
require 'axlsx/workbook/worksheet/data_bar.rb'
require 'axlsx/workbook/worksheet/icon_set.rb'
require 'axlsx/workbook/worksheet/conditional_formatting.rb'
require 'axlsx/workbook/worksheet/conditional_formatting_rule.rb'
require 'axlsx/workbook/worksheet/row.rb'
require 'axlsx/workbook/worksheet/col.rb'
+require 'axlsx/workbook/worksheet/comments.rb'
+require 'axlsx/workbook/worksheet/comment.rb'
require 'axlsx/workbook/worksheet/worksheet.rb'
require 'axlsx/workbook/shared_strings_table.rb'
require 'axlsx/workbook/worksheet/table.rb'
# The Workbook class is an xlsx workbook that manages worksheets, charts, drawings and styles.
@@ -80,18 +84,30 @@
# @see Worksheet#add_chart
# @see Drawing
# @return [SimpleTypedList]
attr_reader :drawings
+ # pretty sure this two are always empty and can be removed.
+
+
# A colllection of tables associated with this workbook
# @note The recommended way to manage drawings is Worksheet#add_table
# @see Worksheet#add_table
# @see Table
# @return [SimpleTypedList]
attr_reader :tables
+ # A colllection of comments associated with this workbook
+ # @note The recommended way to manage comments is Worksheet#add_comment
+ # @see Worksheet#add_comment
+ # @see Comment
+ # @return [Comments]
+ def comments
+ self.worksheets.map { |ws| ws.comments }.compact
+ end
+
# The styles associated with this workbook
# @note The recommended way to manage styles is Styles#add_style
# @see Style#add_style
# @see Style
# @return [Styles]
@@ -121,10 +137,15 @@
@styles = Styles.new
@worksheets = SimpleTypedList.new Worksheet
@drawings = SimpleTypedList.new Drawing
@charts = SimpleTypedList.new Chart
@images = SimpleTypedList.new Pic
+
+ # Are these even used????? Check package serialization parts
@tables = SimpleTypedList.new Table
+ @comments = SimpleTypedList.new Comments
+
+
@use_autowidth = true
self.date1904= !options[:date1904].nil? && options[:date1904]
yield self if block_given?
end