caxlsx 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/examples/generate.rb +3 -1
- data/lib/axlsx/content_type/abstract_content_type.rb +4 -1
- data/lib/axlsx/content_type/content_type.rb +1 -1
- data/lib/axlsx/content_type/default.rb +4 -1
- data/lib/axlsx/content_type/override.rb +4 -1
- data/lib/axlsx/doc_props/app.rb +91 -24
- data/lib/axlsx/drawing/area_series.rb +8 -2
- data/lib/axlsx/drawing/axis.rb +24 -6
- data/lib/axlsx/drawing/bar_series.rb +12 -3
- data/lib/axlsx/drawing/cat_axis.rb +20 -5
- data/lib/axlsx/drawing/chart.rb +32 -8
- data/lib/axlsx/drawing/d_lbls.rb +4 -4
- data/lib/axlsx/drawing/drawing.rb +1 -0
- data/lib/axlsx/drawing/hyperlink.rb +12 -3
- data/lib/axlsx/drawing/line_series.rb +8 -2
- data/lib/axlsx/drawing/marker.rb +19 -4
- data/lib/axlsx/drawing/one_cell_anchor.rb +8 -2
- data/lib/axlsx/drawing/pic.rb +13 -4
- data/lib/axlsx/drawing/pie_3D_chart.rb +1 -1
- data/lib/axlsx/drawing/pie_chart.rb +36 -0
- data/lib/axlsx/drawing/pie_series.rb +16 -4
- data/lib/axlsx/drawing/scaling.rb +18 -4
- data/lib/axlsx/drawing/ser_axis.rb +8 -2
- data/lib/axlsx/drawing/series.rb +8 -2
- data/lib/axlsx/drawing/view_3D.rb +8 -2
- data/lib/axlsx/package.rb +4 -1
- data/lib/axlsx/rels/relationship.rb +13 -3
- data/lib/axlsx/rels/relationships.rb +1 -1
- data/lib/axlsx/stylesheet/border.rb +12 -3
- data/lib/axlsx/stylesheet/border_pr.rb +14 -3
- data/lib/axlsx/stylesheet/cell_alignment.rb +38 -9
- data/lib/axlsx/stylesheet/cell_protection.rb +9 -2
- data/lib/axlsx/stylesheet/cell_style.rb +29 -6
- data/lib/axlsx/stylesheet/color.rb +8 -2
- data/lib/axlsx/stylesheet/dxf.rb +29 -6
- data/lib/axlsx/stylesheet/fill.rb +4 -1
- data/lib/axlsx/stylesheet/font.rb +58 -12
- data/lib/axlsx/stylesheet/gradient_fill.rb +8 -2
- data/lib/axlsx/stylesheet/gradient_stop.rb +9 -2
- data/lib/axlsx/stylesheet/num_fmt.rb +8 -2
- data/lib/axlsx/stylesheet/pattern_fill.rb +14 -3
- data/lib/axlsx/stylesheet/styles.rb +57 -13
- data/lib/axlsx/stylesheet/table_style.rb +15 -4
- data/lib/axlsx/stylesheet/table_style_element.rb +12 -3
- data/lib/axlsx/stylesheet/table_styles.rb +10 -3
- data/lib/axlsx/stylesheet/xf.rb +68 -15
- data/lib/axlsx/util/accessors.rb +8 -6
- data/lib/axlsx/util/storage.rb +1 -1
- data/lib/axlsx/version.rb +1 -1
- data/lib/axlsx/workbook/defined_names.rb +1 -1
- data/lib/axlsx/workbook/workbook.rb +19 -6
- data/lib/axlsx/workbook/workbook_views.rb +1 -1
- data/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb +4 -2
- data/lib/axlsx/workbook/worksheet/cell.rb +30 -10
- data/lib/axlsx/workbook/worksheet/cfvo.rb +8 -2
- data/lib/axlsx/workbook/worksheet/col_breaks.rb +1 -1
- data/lib/axlsx/workbook/worksheet/cols.rb +1 -1
- data/lib/axlsx/workbook/worksheet/conditional_formatting.rb +8 -2
- data/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb +69 -14
- data/lib/axlsx/workbook/worksheet/conditional_formattings.rb +1 -1
- data/lib/axlsx/workbook/worksheet/data_validation.rb +52 -13
- data/lib/axlsx/workbook/worksheet/data_validations.rb +1 -1
- data/lib/axlsx/workbook/worksheet/icon_set.rb +16 -4
- data/lib/axlsx/workbook/worksheet/merged_cells.rb +1 -1
- data/lib/axlsx/workbook/worksheet/page_margins.rb +30 -7
- data/lib/axlsx/workbook/worksheet/page_set_up_pr.rb +1 -2
- data/lib/axlsx/workbook/worksheet/page_setup.rb +30 -7
- data/lib/axlsx/workbook/worksheet/pane.rb +8 -2
- data/lib/axlsx/workbook/worksheet/pivot_tables.rb +1 -1
- data/lib/axlsx/workbook/worksheet/protected_ranges.rb +1 -1
- data/lib/axlsx/workbook/worksheet/rich_text_run.rb +30 -10
- data/lib/axlsx/workbook/worksheet/row.rb +5 -2
- data/lib/axlsx/workbook/worksheet/row_breaks.rb +1 -1
- data/lib/axlsx/workbook/worksheet/selection.rb +8 -2
- data/lib/axlsx/workbook/worksheet/sheet_protection.rb +1 -1
- data/lib/axlsx/workbook/worksheet/sheet_view.rb +30 -9
- data/lib/axlsx/workbook/worksheet/table_style_info.rb +1 -1
- data/lib/axlsx/workbook/worksheet/tables.rb +1 -1
- data/lib/axlsx/workbook/worksheet/worksheet.rb +18 -2
- data/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb +1 -1
- data/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb +1 -1
- metadata +6 -44
@@ -155,33 +155,88 @@ module Axlsx
|
|
155
155
|
end
|
156
156
|
|
157
157
|
# @see type
|
158
|
-
def type=(v)
|
158
|
+
def type=(v)
|
159
|
+
Axlsx.validate_conditional_formatting_type(v)
|
160
|
+
@type = v
|
161
|
+
end
|
162
|
+
|
159
163
|
# @see aboveAverage
|
160
|
-
def aboveAverage=(v)
|
164
|
+
def aboveAverage=(v)
|
165
|
+
Axlsx.validate_boolean(v)
|
166
|
+
@aboveAverage = v
|
167
|
+
end
|
168
|
+
|
161
169
|
# @see bottom
|
162
|
-
def bottom=(v)
|
170
|
+
def bottom=(v)
|
171
|
+
Axlsx.validate_boolean(v)
|
172
|
+
@bottom = v
|
173
|
+
end
|
174
|
+
|
163
175
|
# @see dxfId
|
164
|
-
def dxfId=(v)
|
176
|
+
def dxfId=(v)
|
177
|
+
Axlsx.validate_unsigned_numeric(v)
|
178
|
+
@dxfId = v
|
179
|
+
end
|
180
|
+
|
165
181
|
# @see equalAverage
|
166
|
-
def equalAverage=(v)
|
182
|
+
def equalAverage=(v)
|
183
|
+
Axlsx.validate_boolean(v)
|
184
|
+
@equalAverage = v
|
185
|
+
end
|
186
|
+
|
167
187
|
# @see priority
|
168
|
-
def priority=(v)
|
188
|
+
def priority=(v)
|
189
|
+
Axlsx.validate_unsigned_numeric(v)
|
190
|
+
@priority = v
|
191
|
+
end
|
192
|
+
|
169
193
|
# @see operator
|
170
|
-
def operator=(v)
|
194
|
+
def operator=(v)
|
195
|
+
Axlsx.validate_conditional_formatting_operator(v)
|
196
|
+
@operator = v
|
197
|
+
end
|
198
|
+
|
171
199
|
# @see text
|
172
|
-
def text=(v)
|
200
|
+
def text=(v)
|
201
|
+
Axlsx.validate_string(v)
|
202
|
+
@text = v
|
203
|
+
end
|
204
|
+
|
173
205
|
# @see percent
|
174
|
-
def percent=(v)
|
206
|
+
def percent=(v)
|
207
|
+
Axlsx.validate_boolean(v)
|
208
|
+
@percent = v
|
209
|
+
end
|
210
|
+
|
175
211
|
# @see rank
|
176
|
-
def rank=(v)
|
212
|
+
def rank=(v)
|
213
|
+
Axlsx.validate_unsigned_numeric(v)
|
214
|
+
@rank = v
|
215
|
+
end
|
216
|
+
|
177
217
|
# @see stdDev
|
178
|
-
def stdDev=(v)
|
218
|
+
def stdDev=(v)
|
219
|
+
Axlsx.validate_unsigned_numeric(v)
|
220
|
+
@stdDev = v
|
221
|
+
end
|
222
|
+
|
179
223
|
# @see stopIfTrue
|
180
|
-
def stopIfTrue=(v)
|
224
|
+
def stopIfTrue=(v)
|
225
|
+
Axlsx.validate_boolean(v)
|
226
|
+
@stopIfTrue = v
|
227
|
+
end
|
228
|
+
|
181
229
|
# @see timePeriod
|
182
|
-
def timePeriod=(v)
|
230
|
+
def timePeriod=(v)
|
231
|
+
Axlsx.validate_time_period_type(v)
|
232
|
+
@timePeriod = v
|
233
|
+
end
|
234
|
+
|
183
235
|
# @see formula
|
184
|
-
def formula=(v)
|
236
|
+
def formula=(v)
|
237
|
+
[*v].each { |x| Axlsx.validate_string(x) }
|
238
|
+
@formula = [*v].map { |form| ::CGI.escapeHTML(form) }
|
239
|
+
end
|
185
240
|
|
186
241
|
# @see color_scale
|
187
242
|
def color_scale=(v)
|
@@ -178,31 +178,58 @@ module Axlsx
|
|
178
178
|
attr_reader :type
|
179
179
|
|
180
180
|
# @see formula1
|
181
|
-
def formula1=(v)
|
181
|
+
def formula1=(v)
|
182
|
+
Axlsx.validate_string(v)
|
183
|
+
@formula1 = v
|
184
|
+
end
|
182
185
|
|
183
186
|
# @see formula2
|
184
|
-
def formula2=(v)
|
187
|
+
def formula2=(v)
|
188
|
+
Axlsx.validate_string(v)
|
189
|
+
@formula2 = v
|
190
|
+
end
|
185
191
|
|
186
192
|
# @see allowBlank
|
187
|
-
def allowBlank=(v)
|
193
|
+
def allowBlank=(v)
|
194
|
+
Axlsx.validate_boolean(v)
|
195
|
+
@allowBlank = v
|
196
|
+
end
|
188
197
|
|
189
198
|
# @see error
|
190
|
-
def error=(v)
|
199
|
+
def error=(v)
|
200
|
+
Axlsx.validate_string(v)
|
201
|
+
@error = v
|
202
|
+
end
|
191
203
|
|
192
204
|
# @see errorStyle
|
193
|
-
def errorStyle=(v)
|
205
|
+
def errorStyle=(v)
|
206
|
+
Axlsx.validate_data_validation_error_style(v)
|
207
|
+
@errorStyle = v
|
208
|
+
end
|
194
209
|
|
195
210
|
# @see errorTitle
|
196
|
-
def errorTitle=(v)
|
211
|
+
def errorTitle=(v)
|
212
|
+
Axlsx.validate_string(v)
|
213
|
+
@errorTitle = v
|
214
|
+
end
|
197
215
|
|
198
216
|
# @see operator
|
199
|
-
def operator=(v)
|
217
|
+
def operator=(v)
|
218
|
+
Axlsx.validate_data_validation_operator(v)
|
219
|
+
@operator = v
|
220
|
+
end
|
200
221
|
|
201
222
|
# @see prompt
|
202
|
-
def prompt=(v)
|
223
|
+
def prompt=(v)
|
224
|
+
Axlsx.validate_string(v)
|
225
|
+
@prompt = v
|
226
|
+
end
|
203
227
|
|
204
228
|
# @see promptTitle
|
205
|
-
def promptTitle=(v)
|
229
|
+
def promptTitle=(v)
|
230
|
+
Axlsx.validate_string(v)
|
231
|
+
@promptTitle = v
|
232
|
+
end
|
206
233
|
|
207
234
|
# @see showDropDown
|
208
235
|
def showDropDown=(v)
|
@@ -219,16 +246,28 @@ module Axlsx
|
|
219
246
|
end
|
220
247
|
|
221
248
|
# @see showErrorMessage
|
222
|
-
def showErrorMessage=(v)
|
249
|
+
def showErrorMessage=(v)
|
250
|
+
Axlsx.validate_boolean(v)
|
251
|
+
@showErrorMessage = v
|
252
|
+
end
|
223
253
|
|
224
254
|
# @see showInputMessage
|
225
|
-
def showInputMessage=(v)
|
255
|
+
def showInputMessage=(v)
|
256
|
+
Axlsx.validate_boolean(v)
|
257
|
+
@showInputMessage = v
|
258
|
+
end
|
226
259
|
|
227
260
|
# @see sqref
|
228
|
-
def sqref=(v)
|
261
|
+
def sqref=(v)
|
262
|
+
Axlsx.validate_string(v)
|
263
|
+
@sqref = v
|
264
|
+
end
|
229
265
|
|
230
266
|
# @see type
|
231
|
-
def type=(v)
|
267
|
+
def type=(v)
|
268
|
+
Axlsx.validate_data_validation_type(v)
|
269
|
+
@type = v
|
270
|
+
end
|
232
271
|
|
233
272
|
# Serializes the data validation
|
234
273
|
# @param [String] str
|
@@ -56,7 +56,10 @@ module Axlsx
|
|
56
56
|
attr_reader :interpolationPoints
|
57
57
|
|
58
58
|
# @see iconSet
|
59
|
-
def iconSet=(v)
|
59
|
+
def iconSet=(v)
|
60
|
+
Axlsx.validate_icon_set(v)
|
61
|
+
@iconSet = v
|
62
|
+
end
|
60
63
|
|
61
64
|
# @see interpolationPoints
|
62
65
|
def interpolationPoints=(v)
|
@@ -66,13 +69,22 @@ module Axlsx
|
|
66
69
|
end
|
67
70
|
|
68
71
|
# @see showValue
|
69
|
-
def showValue=(v)
|
72
|
+
def showValue=(v)
|
73
|
+
Axlsx.validate_boolean(v)
|
74
|
+
@showValue = v
|
75
|
+
end
|
70
76
|
|
71
77
|
# @see percent
|
72
|
-
def percent=(v)
|
78
|
+
def percent=(v)
|
79
|
+
Axlsx.validate_boolean(v)
|
80
|
+
@percent = v
|
81
|
+
end
|
73
82
|
|
74
83
|
# @see reverse
|
75
|
-
def reverse=(v)
|
84
|
+
def reverse=(v)
|
85
|
+
Axlsx.validate_boolean(v)
|
86
|
+
@reverse = v
|
87
|
+
end
|
76
88
|
|
77
89
|
# Serialize this object to an xml string
|
78
90
|
# @param [String] str
|
@@ -73,22 +73,45 @@ module Axlsx
|
|
73
73
|
margins.select do |k, v|
|
74
74
|
next unless MARGIN_KEYS.include? k
|
75
75
|
|
76
|
-
send("#{k}=", v)
|
76
|
+
send(:"#{k}=", v)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
80
|
# @see left
|
81
|
-
def left=(v)
|
81
|
+
def left=(v)
|
82
|
+
Axlsx.validate_unsigned_numeric(v)
|
83
|
+
@left = v
|
84
|
+
end
|
85
|
+
|
82
86
|
# @see right
|
83
|
-
def right=(v)
|
87
|
+
def right=(v)
|
88
|
+
Axlsx.validate_unsigned_numeric(v)
|
89
|
+
@right = v
|
90
|
+
end
|
91
|
+
|
84
92
|
# @see top
|
85
|
-
def top=(v)
|
93
|
+
def top=(v)
|
94
|
+
Axlsx.validate_unsigned_numeric(v)
|
95
|
+
@top = v
|
96
|
+
end
|
97
|
+
|
86
98
|
# @see bottom
|
87
|
-
def bottom=(v)
|
99
|
+
def bottom=(v)
|
100
|
+
Axlsx.validate_unsigned_numeric(v)
|
101
|
+
@bottom = v
|
102
|
+
end
|
103
|
+
|
88
104
|
# @see header
|
89
|
-
def header=(v)
|
105
|
+
def header=(v)
|
106
|
+
Axlsx.validate_unsigned_numeric(v)
|
107
|
+
@header = v
|
108
|
+
end
|
109
|
+
|
90
110
|
# @see footer
|
91
|
-
def footer=(v)
|
111
|
+
def footer=(v)
|
112
|
+
Axlsx.validate_unsigned_numeric(v)
|
113
|
+
@footer = v
|
114
|
+
end
|
92
115
|
|
93
116
|
# Serializes the page margins element
|
94
117
|
# @param [String] str
|
@@ -17,8 +17,7 @@ module Axlsx
|
|
17
17
|
|
18
18
|
serializable_attributes :auto_page_breaks, :fit_to_page
|
19
19
|
|
20
|
-
attr_reader :auto_page_breaks
|
21
|
-
attr_reader :fit_to_page
|
20
|
+
attr_reader :auto_page_breaks, :fit_to_page
|
22
21
|
|
23
22
|
# Flag indicating whether the Fit to Page print option is enabled.
|
24
23
|
# @param [Boolean] value
|
@@ -198,17 +198,40 @@ module Axlsx
|
|
198
198
|
end
|
199
199
|
|
200
200
|
# @see fit_to_height
|
201
|
-
def fit_to_height=(v)
|
201
|
+
def fit_to_height=(v)
|
202
|
+
Axlsx.validate_unsigned_int(v)
|
203
|
+
@fit_to_height = v
|
204
|
+
end
|
205
|
+
|
202
206
|
# @see fit_to_width
|
203
|
-
def fit_to_width=(v)
|
207
|
+
def fit_to_width=(v)
|
208
|
+
Axlsx.validate_unsigned_int(v)
|
209
|
+
@fit_to_width = v
|
210
|
+
end
|
211
|
+
|
204
212
|
# @see orientation
|
205
|
-
def orientation=(v)
|
213
|
+
def orientation=(v)
|
214
|
+
Axlsx.validate_page_orientation(v)
|
215
|
+
@orientation = v
|
216
|
+
end
|
217
|
+
|
206
218
|
# @see paper_height
|
207
|
-
def paper_height=(v)
|
219
|
+
def paper_height=(v)
|
220
|
+
Axlsx.validate_number_with_unit(v)
|
221
|
+
@paper_height = v
|
222
|
+
end
|
223
|
+
|
208
224
|
# @see paper_width
|
209
|
-
def paper_width=(v)
|
225
|
+
def paper_width=(v)
|
226
|
+
Axlsx.validate_number_with_unit(v)
|
227
|
+
@paper_width = v
|
228
|
+
end
|
229
|
+
|
210
230
|
# @see scale
|
211
|
-
def scale=(v)
|
231
|
+
def scale=(v)
|
232
|
+
Axlsx.validate_scale_10_400(v)
|
233
|
+
@scale = v
|
234
|
+
end
|
212
235
|
|
213
236
|
# convenience method to achieve sanity when setting fit_to_width and fit_to_height
|
214
237
|
# as they both default to 1 if only their counterpart is specified.
|
@@ -226,7 +249,7 @@ module Axlsx
|
|
226
249
|
# @return [Boolean]
|
227
250
|
def fit_to_page?
|
228
251
|
# is there some better way to express this?
|
229
|
-
|
252
|
+
!fit_to_width.nil? || !fit_to_height.nil?
|
230
253
|
end
|
231
254
|
|
232
255
|
# Serializes the page settings element.
|
@@ -114,10 +114,16 @@ module Axlsx
|
|
114
114
|
end
|
115
115
|
|
116
116
|
# @see x_split
|
117
|
-
def x_split=(v)
|
117
|
+
def x_split=(v)
|
118
|
+
Axlsx.validate_unsigned_int(v)
|
119
|
+
@x_split = v
|
120
|
+
end
|
118
121
|
|
119
122
|
# @see y_split
|
120
|
-
def y_split=(v)
|
123
|
+
def y_split=(v)
|
124
|
+
Axlsx.validate_unsigned_int(v)
|
125
|
+
@y_split = v
|
126
|
+
end
|
121
127
|
|
122
128
|
# Serializes the data validation
|
123
129
|
# @param [String] str
|
@@ -29,7 +29,9 @@ module Axlsx
|
|
29
29
|
attr_reader :font_name
|
30
30
|
|
31
31
|
# @see font_name
|
32
|
-
def font_name=(v)
|
32
|
+
def font_name=(v)
|
33
|
+
set_run_style :validate_string, :font_name, v
|
34
|
+
end
|
33
35
|
|
34
36
|
# The inline charset property for the cell
|
35
37
|
# As far as I can tell, this is pretty much ignored. However, based on the spec it should be one of the following:
|
@@ -56,7 +58,9 @@ module Axlsx
|
|
56
58
|
attr_reader :charset
|
57
59
|
|
58
60
|
# @see charset
|
59
|
-
def charset=(v)
|
61
|
+
def charset=(v)
|
62
|
+
set_run_style :validate_unsigned_int, :charset, v
|
63
|
+
end
|
60
64
|
|
61
65
|
# The inline family property for the cell
|
62
66
|
# @return [Integer]
|
@@ -77,49 +81,63 @@ module Axlsx
|
|
77
81
|
attr_reader :b
|
78
82
|
|
79
83
|
# @see b
|
80
|
-
def b=(v)
|
84
|
+
def b=(v)
|
85
|
+
set_run_style :validate_boolean, :b, v
|
86
|
+
end
|
81
87
|
|
82
88
|
# The inline italic property for the cell
|
83
89
|
# @return [Boolean]
|
84
90
|
attr_reader :i
|
85
91
|
|
86
92
|
# @see i
|
87
|
-
def i=(v)
|
93
|
+
def i=(v)
|
94
|
+
set_run_style :validate_boolean, :i, v
|
95
|
+
end
|
88
96
|
|
89
97
|
# The inline strike property for the cell
|
90
98
|
# @return [Boolean]
|
91
99
|
attr_reader :strike
|
92
100
|
|
93
101
|
# @see strike
|
94
|
-
def strike=(v)
|
102
|
+
def strike=(v)
|
103
|
+
set_run_style :validate_boolean, :strike, v
|
104
|
+
end
|
95
105
|
|
96
106
|
# The inline outline property for the cell
|
97
107
|
# @return [Boolean]
|
98
108
|
attr_reader :outline
|
99
109
|
|
100
110
|
# @see outline
|
101
|
-
def outline=(v)
|
111
|
+
def outline=(v)
|
112
|
+
set_run_style :validate_boolean, :outline, v
|
113
|
+
end
|
102
114
|
|
103
115
|
# The inline shadow property for the cell
|
104
116
|
# @return [Boolean]
|
105
117
|
attr_reader :shadow
|
106
118
|
|
107
119
|
# @see shadow
|
108
|
-
def shadow=(v)
|
120
|
+
def shadow=(v)
|
121
|
+
set_run_style :validate_boolean, :shadow, v
|
122
|
+
end
|
109
123
|
|
110
124
|
# The inline condense property for the cell
|
111
125
|
# @return [Boolean]
|
112
126
|
attr_reader :condense
|
113
127
|
|
114
128
|
# @see condense
|
115
|
-
def condense=(v)
|
129
|
+
def condense=(v)
|
130
|
+
set_run_style :validate_boolean, :condense, v
|
131
|
+
end
|
116
132
|
|
117
133
|
# The inline extend property for the cell
|
118
134
|
# @return [Boolean]
|
119
135
|
attr_reader :extend
|
120
136
|
|
121
137
|
# @see extend
|
122
|
-
def extend=(v)
|
138
|
+
def extend=(v)
|
139
|
+
set_run_style :validate_boolean, :extend, v
|
140
|
+
end
|
123
141
|
|
124
142
|
# The inline underline property for the cell.
|
125
143
|
# It must be one of :none, :single, :double, :singleAccounting, :doubleAccounting, true
|
@@ -148,7 +166,9 @@ module Axlsx
|
|
148
166
|
attr_reader :sz
|
149
167
|
|
150
168
|
# @see sz
|
151
|
-
def sz=(v)
|
169
|
+
def sz=(v)
|
170
|
+
set_run_style :validate_unsigned_int, :sz, v
|
171
|
+
end
|
152
172
|
|
153
173
|
# The inline vertical alignment property for the cell
|
154
174
|
# this must be one of [:baseline, :subscript, :superscript]
|
@@ -143,7 +143,10 @@ module Axlsx
|
|
143
143
|
private
|
144
144
|
|
145
145
|
# assigns the owning worksheet for this row
|
146
|
-
def worksheet=(v)
|
146
|
+
def worksheet=(v)
|
147
|
+
DataTypeValidator.validate :row_worksheet, Worksheet, v
|
148
|
+
@worksheet = v
|
149
|
+
end
|
147
150
|
|
148
151
|
# Converts values, types, and style options into cells and associates them with this row.
|
149
152
|
# A new cell is created for each item in the values array.
|
@@ -160,7 +163,7 @@ module Axlsx
|
|
160
163
|
types, style, formula_values, escape_formulas, offset = options.delete(:types), options.delete(:style), options.delete(:formula_values), options.delete(:escape_formulas), options.delete(:offset)
|
161
164
|
offset.to_i.times { |index| self[index] = Cell.new(self) } if offset
|
162
165
|
values.each_with_index do |value, index|
|
163
|
-
options[:style] = style.is_a?(Array) ? style[index] : style
|
166
|
+
options[:style] = (style.is_a?(Array) ? style[index] : style) || worksheet.column_info[index]&.style
|
164
167
|
options[:type] = types.is_a?(Array) ? types[index] : types if types
|
165
168
|
options[:escape_formulas] = escape_formulas.is_a?(Array) ? escape_formulas[index] : escape_formulas unless escape_formulas.nil?
|
166
169
|
options[:formula_value] = formula_values[index] if formula_values.is_a?(Array)
|
@@ -80,7 +80,10 @@ module Axlsx
|
|
80
80
|
end
|
81
81
|
|
82
82
|
# @see active_cell_id
|
83
|
-
def active_cell_id=(v)
|
83
|
+
def active_cell_id=(v)
|
84
|
+
Axlsx.validate_unsigned_int(v)
|
85
|
+
@active_cell_id = v
|
86
|
+
end
|
84
87
|
|
85
88
|
# @see pane
|
86
89
|
def pane=(v)
|
@@ -89,7 +92,10 @@ module Axlsx
|
|
89
92
|
end
|
90
93
|
|
91
94
|
# @see sqref
|
92
|
-
def sqref=(v)
|
95
|
+
def sqref=(v)
|
96
|
+
Axlsx.validate_string(v)
|
97
|
+
@sqref = v
|
98
|
+
end
|
93
99
|
|
94
100
|
# Serializes the data validation
|
95
101
|
# @param [String] str
|
@@ -33,8 +33,8 @@ module Axlsx
|
|
33
33
|
def initialize(options = {})
|
34
34
|
# defaults
|
35
35
|
@color_id = @top_left_cell = @pane = nil
|
36
|
-
@right_to_left = @show_formulas = @
|
37
|
-
@default_grid_color = @show_grid_lines = @show_row_col_headers = @show_ruler = @show_zeros = true
|
36
|
+
@right_to_left = @show_formulas = @show_white_space = @tab_selected = @window_protection = false
|
37
|
+
@default_grid_color = @show_grid_lines = @show_row_col_headers = @show_ruler = @show_zeros = @show_outline_symbols = true
|
38
38
|
@zoom_scale = 100
|
39
39
|
@zoom_scale_normal = @zoom_scale_page_layout_view = @zoom_scale_sheet_layout_view = @workbook_view_id = 0
|
40
40
|
@selections = {}
|
@@ -162,7 +162,10 @@ module Axlsx
|
|
162
162
|
end
|
163
163
|
|
164
164
|
# @see color_id
|
165
|
-
def color_id=(v)
|
165
|
+
def color_id=(v)
|
166
|
+
Axlsx.validate_unsigned_int(v)
|
167
|
+
@color_id = v
|
168
|
+
end
|
166
169
|
|
167
170
|
# @see top_left_cell
|
168
171
|
def top_left_cell=(v)
|
@@ -172,22 +175,40 @@ module Axlsx
|
|
172
175
|
end
|
173
176
|
|
174
177
|
# @see view
|
175
|
-
def view=(v)
|
178
|
+
def view=(v)
|
179
|
+
Axlsx.validate_sheet_view_type(v)
|
180
|
+
@view = v
|
181
|
+
end
|
176
182
|
|
177
183
|
# @see workbook_view_id
|
178
|
-
def workbook_view_id=(v)
|
184
|
+
def workbook_view_id=(v)
|
185
|
+
Axlsx.validate_unsigned_int(v)
|
186
|
+
@workbook_view_id = v
|
187
|
+
end
|
179
188
|
|
180
189
|
# @see zoom_scale
|
181
|
-
def zoom_scale=(v)
|
190
|
+
def zoom_scale=(v)
|
191
|
+
Axlsx.validate_scale_0_10_400(v)
|
192
|
+
@zoom_scale = v
|
193
|
+
end
|
182
194
|
|
183
195
|
# @see zoom_scale_normal
|
184
|
-
def zoom_scale_normal=(v)
|
196
|
+
def zoom_scale_normal=(v)
|
197
|
+
Axlsx.validate_scale_0_10_400(v)
|
198
|
+
@zoom_scale_normal = v
|
199
|
+
end
|
185
200
|
|
186
201
|
# @see zoom_scale_page_layout_view
|
187
|
-
def zoom_scale_page_layout_view=(v)
|
202
|
+
def zoom_scale_page_layout_view=(v)
|
203
|
+
Axlsx.validate_scale_0_10_400(v)
|
204
|
+
@zoom_scale_page_layout_view = v
|
205
|
+
end
|
188
206
|
|
189
207
|
# @see zoom_scale_sheet_layout_view
|
190
|
-
def zoom_scale_sheet_layout_view=(v)
|
208
|
+
def zoom_scale_sheet_layout_view=(v)
|
209
|
+
Axlsx.validate_scale_0_10_400(v)
|
210
|
+
@zoom_scale_sheet_layout_view = v
|
211
|
+
end
|
191
212
|
|
192
213
|
# Serializes the data validation
|
193
214
|
# @param [String] str
|