summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2013-08-17 15:34:25 +0900
committerRandy Morgan <[email protected]>2013-08-17 15:34:25 +0900
commitee13b1cb4506232fa7ec5edc9fcc4dc796b40431 (patch)
tree6aabd836de4dd98195cca19cbd0691fcdb8626d7 /lib
parent2df443781d2a06d78ebed9a7915cb3544acb37e6 (diff)
downloadcaxlsx-ee13b1cb4506232fa7ec5edc9fcc4dc796b40431.tar.gz
caxlsx-ee13b1cb4506232fa7ec5edc9fcc4dc796b40431.zip
add first bits of col/row break support
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/workbook.rb1
-rw-r--r--lib/axlsx/workbook/worksheet/break.rb41
2 files changed, 42 insertions, 0 deletions
diff --git a/lib/axlsx/workbook/workbook.rb b/lib/axlsx/workbook/workbook.rb
index d122f253..3356b9de 100644
--- a/lib/axlsx/workbook/workbook.rb
+++ b/lib/axlsx/workbook/workbook.rb
@@ -34,6 +34,7 @@ require 'axlsx/workbook/worksheet/worksheet_drawing.rb'
require 'axlsx/workbook/worksheet/worksheet_comments.rb'
require 'axlsx/workbook/worksheet/worksheet_hyperlink'
require 'axlsx/workbook/worksheet/worksheet_hyperlinks'
+require 'axlsx/workbook/worksheet/break'
require 'axlsx/workbook/worksheet/worksheet.rb'
require 'axlsx/workbook/shared_strings_table.rb'
require 'axlsx/workbook/defined_name.rb'
diff --git a/lib/axlsx/workbook/worksheet/break.rb b/lib/axlsx/workbook/worksheet/break.rb
new file mode 100644
index 00000000..9de2c84c
--- /dev/null
+++ b/lib/axlsx/workbook/worksheet/break.rb
@@ -0,0 +1,41 @@
+module Axlsx
+
+ # The Break class stores the details for row and column page breaks.
+ # @see RowBreaks, ColBreaks
+ class Break
+
+ include Axlsx::OptionsParser
+ include Axlsx::Accessors
+ include Axlsx::SerializedAttributes
+
+ # Creates a new Break object
+ # @param worksheet The worksheet that owns this break
+ # @param options A hash of attribute options for this break.
+ # @option options [Integer] id Zero-based row or column Id of the page break. Breaks occur above the specified row and left of the specified column.
+ # @option options [Integer] min Zero-based index of start row or column of the break. For row breaks, specifies column index; for column breaks, specifies row index.
+ # @option options [Integer] max Zero-based index of end row or column of the break. For row breaks, specifies column index; for column breaks, specifies row index.
+ # @option options [Boolean] man Manual Break flag. 1 means the break is a manually inserted break.
+ # @option option [Boolean] pt Flag indicating that a PivotTable created this break.
+ def initialize(worksheet, options={})
+ @worksheet = worksheet
+ parse_options options
+ yield self if block_given?
+ end
+
+ unsigned_int_attr_accessor :id, :min, :max
+ boolean_attr_accessor :man, :pt
+ serializable_attributes :id, :min, :max, :man, :pt
+
+ attr_reader :worksheet
+
+ # serializes the break to xml
+ def to_xml_string(str='')
+ str << '<brk'
+ serialized_attributes str
+ str << '></brk>'
+ end
+
+ end
+
+end
+