writeexcel 0.6.6 → 0.6.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +0 -0
- data/.gitattributes +0 -0
- data/README.rdoc +9 -35
- data/Rakefile +0 -0
- data/VERSION +1 -1
- data/charts/chartex.rb +0 -0
- data/charts/demo1.rb +0 -0
- data/charts/demo101.bin +0 -0
- data/charts/demo2.rb +0 -0
- data/charts/demo201.bin +0 -0
- data/charts/demo3.rb +0 -0
- data/charts/demo301.bin +0 -0
- data/charts/demo4.rb +0 -0
- data/charts/demo401.bin +0 -0
- data/charts/demo5.rb +0 -0
- data/charts/demo501.bin +0 -0
- data/examples/a_simple.rb +0 -0
- data/examples/autofilter.rb +0 -0
- data/examples/bigfile.rb +0 -0
- data/examples/chart_area.rb +0 -0
- data/examples/chart_bar.rb +0 -0
- data/examples/chart_column.rb +0 -0
- data/examples/chart_line.rb +0 -0
- data/examples/chart_pie.rb +0 -0
- data/examples/chart_scatter.rb +0 -0
- data/examples/chart_stock.rb +0 -0
- data/examples/chess.rb +0 -0
- data/examples/colors.rb +0 -0
- data/examples/comments1.rb +0 -0
- data/examples/comments2.rb +0 -0
- data/examples/copyformat.rb +0 -0
- data/examples/data_validate.rb +0 -0
- data/examples/date_time.rb +0 -0
- data/examples/defined_name.rb +0 -0
- data/examples/demo.rb +0 -0
- data/examples/diag_border.rb +0 -0
- data/examples/formats.rb +0 -0
- data/examples/formula_result.rb +0 -0
- data/examples/header.rb +0 -0
- data/examples/hide_sheet.rb +0 -0
- data/examples/hyperlink.rb +0 -0
- data/examples/images.rb +0 -0
- data/examples/indent.rb +0 -0
- data/examples/merge1.rb +0 -0
- data/examples/merge2.rb +0 -0
- data/examples/merge3.rb +0 -0
- data/examples/merge4.rb +0 -0
- data/examples/merge5.rb +0 -0
- data/examples/merge6.rb +0 -0
- data/examples/outline.rb +0 -0
- data/examples/outline_collapsed.rb +0 -0
- data/examples/panes.rb +0 -0
- data/examples/properties.rb +0 -0
- data/examples/properties_jp.rb +0 -0
- data/examples/protection.rb +0 -0
- data/examples/regions.rb +0 -0
- data/examples/repeat.rb +0 -0
- data/examples/republic.png +0 -0
- data/examples/right_to_left.rb +0 -0
- data/examples/row_wrap.rb +0 -0
- data/examples/set_first_sheet.rb +14 -0
- data/examples/stats.rb +0 -0
- data/examples/stocks.rb +0 -0
- data/examples/tab_colors.rb +0 -0
- data/examples/utf8.rb +0 -0
- data/examples/write_arrays.rb +0 -0
- data/html/en/doc_en.html +5941 -0
- data/html/images/a_simple.jpg +0 -0
- data/html/images/area1.jpg +0 -0
- data/html/images/bar1.jpg +0 -0
- data/html/images/chart_area.xls +0 -0
- data/html/images/column1.jpg +0 -0
- data/html/images/data_validation.jpg +0 -0
- data/html/images/line1.jpg +0 -0
- data/html/images/pie1.jpg +0 -0
- data/html/images/regions.jpg +0 -0
- data/html/images/scatter1.jpg +0 -0
- data/html/images/stats.jpg +0 -0
- data/html/images/stock1.jpg +0 -0
- data/html/images/stocks.jpg +0 -0
- data/html/index.html +16 -0
- data/html/style.css +433 -0
- data/lib/writeexcel/biffwriter.rb +5 -0
- data/lib/writeexcel/caller_info.rb +0 -0
- data/lib/writeexcel/chart.rb +8 -219
- data/lib/writeexcel/charts/area.rb +0 -0
- data/lib/writeexcel/charts/bar.rb +0 -0
- data/lib/writeexcel/charts/column.rb +0 -0
- data/lib/writeexcel/charts/external.rb +0 -0
- data/lib/writeexcel/charts/line.rb +0 -0
- data/lib/writeexcel/charts/pie.rb +0 -0
- data/lib/writeexcel/charts/scatter.rb +0 -0
- data/lib/writeexcel/charts/stock.rb +0 -0
- data/lib/writeexcel/colors.rb +4 -0
- data/lib/writeexcel/compatibility.rb +0 -0
- data/lib/writeexcel/debug_info.rb +0 -0
- data/lib/writeexcel/excelformula.y +0 -0
- data/lib/writeexcel/excelformulaparser.rb +0 -0
- data/lib/writeexcel/format.rb +2 -28
- data/lib/writeexcel/formula.rb +4 -70
- data/lib/writeexcel/helper.rb +0 -0
- data/lib/writeexcel/image.rb +158 -0
- data/lib/writeexcel/olewriter.rb +0 -0
- data/lib/writeexcel/properties.rb +0 -0
- data/lib/writeexcel/storage_lite.rb +0 -0
- data/lib/writeexcel/workbook.rb +434 -824
- data/lib/writeexcel/worksheet.rb +4194 -4718
- data/lib/writeexcel/write_file.rb +0 -0
- data/lib/writeexcel.rb +0 -0
- data/test/excelfile/Chart1.xls +0 -0
- data/test/excelfile/Chart2.xls +0 -0
- data/test/excelfile/Chart3.xls +0 -0
- data/test/excelfile/Chart4.xls +0 -0
- data/test/excelfile/Chart5.xls +0 -0
- data/test/helper.rb +0 -0
- data/test/perl_output/Chart1.xls.data +0 -0
- data/test/perl_output/Chart2.xls.data +0 -0
- data/test/perl_output/Chart3.xls.data +0 -0
- data/test/perl_output/Chart4.xls.data +0 -0
- data/test/perl_output/Chart5.xls.data +0 -0
- data/test/perl_output/README +0 -0
- data/test/perl_output/a_simple.xls +0 -0
- data/test/perl_output/autofilter.xls +0 -0
- data/test/perl_output/biff_add_continue_testdata +0 -0
- data/test/perl_output/chart_area.xls +0 -0
- data/test/perl_output/chart_bar.xls +0 -0
- data/test/perl_output/chart_column.xls +0 -0
- data/test/perl_output/chart_line.xls +0 -0
- data/test/perl_output/chess.xls +0 -0
- data/test/perl_output/colors.xls +0 -0
- data/test/perl_output/comments1.xls +0 -0
- data/test/perl_output/comments2.xls +0 -0
- data/test/perl_output/data_validate.xls +0 -0
- data/test/perl_output/date_time.xls +0 -0
- data/test/perl_output/defined_name.xls +0 -0
- data/test/perl_output/demo.xls +0 -0
- data/test/perl_output/demo101.bin +0 -0
- data/test/perl_output/demo201.bin +0 -0
- data/test/perl_output/demo301.bin +0 -0
- data/test/perl_output/demo401.bin +0 -0
- data/test/perl_output/demo501.bin +0 -0
- data/test/perl_output/diag_border.xls +0 -0
- data/test/perl_output/f_font_biff +0 -0
- data/test/perl_output/f_font_key +0 -0
- data/test/perl_output/f_xf_biff +0 -0
- data/test/perl_output/file_font_biff +0 -0
- data/test/perl_output/file_font_key +0 -0
- data/test/perl_output/file_xf_biff +0 -0
- data/test/perl_output/formula_result.xls +0 -0
- data/test/perl_output/headers.xls +0 -0
- data/test/perl_output/hidden.xls +0 -0
- data/test/perl_output/hide_zero.xls +0 -0
- data/test/perl_output/hyperlink.xls +0 -0
- data/test/perl_output/images.xls +0 -0
- data/test/perl_output/indent.xls +0 -0
- data/test/perl_output/merge1.xls +0 -0
- data/test/perl_output/merge2.xls +0 -0
- data/test/perl_output/merge3.xls +0 -0
- data/test/perl_output/merge4.xls +0 -0
- data/test/perl_output/merge5.xls +0 -0
- data/test/perl_output/merge6.xls +0 -0
- data/test/perl_output/ole_write_header +0 -0
- data/test/perl_output/outline.xls +0 -0
- data/test/perl_output/outline_collapsed.xls +0 -0
- data/test/perl_output/panes.xls +0 -0
- data/test/perl_output/protection.xls +0 -0
- data/test/perl_output/regions.xls +0 -0
- data/test/perl_output/right_to_left.xls +0 -0
- data/test/perl_output/set_first_sheet.xls +0 -0
- data/test/perl_output/stats.xls +0 -0
- data/test/perl_output/stocks.xls +0 -0
- data/test/perl_output/tab_colors.xls +0 -0
- data/test/perl_output/unicode_cyrillic.xls +0 -0
- data/test/perl_output/utf8.xls +0 -0
- data/test/perl_output/workbook1.xls +0 -0
- data/test/perl_output/workbook2.xls +0 -0
- data/test/perl_output/ws_colinfo +0 -0
- data/test/perl_output/ws_store_colinfo +0 -0
- data/test/perl_output/ws_store_dimensions +0 -0
- data/test/perl_output/ws_store_filtermode +0 -0
- data/test/perl_output/ws_store_filtermode_off +0 -0
- data/test/perl_output/ws_store_filtermode_on +0 -0
- data/test/perl_output/ws_store_selection +0 -0
- data/test/perl_output/ws_store_window2 +0 -0
- data/test/republic.png +0 -0
- data/test/test_00_IEEE_double.rb +0 -0
- data/test/test_01_add_worksheet.rb +0 -0
- data/test/test_02_merge_formats.rb +0 -0
- data/test/test_04_dimensions.rb +27 -27
- data/test/test_05_rows.rb +0 -0
- data/test/test_06_extsst.rb +1 -1
- data/test/test_11_date_time.rb +3 -3
- data/test/test_12_date_only.rb +7 -14
- data/test/test_13_date_seconds.rb +5 -5
- data/test/test_21_escher.rb +138 -138
- data/test/test_22_mso_drawing_group.rb +0 -0
- data/test/test_23_note.rb +4 -4
- data/test/test_24_txo.rb +3 -3
- data/test/test_25_position_object.rb +1 -1
- data/test/test_26_autofilter.rb +3 -3
- data/test/test_27_autofilter.rb +1 -1
- data/test/test_28_autofilter.rb +2 -2
- data/test/test_29_process_jpg.rb +16 -29
- data/test/test_30_validation_dval.rb +3 -3
- data/test/test_31_validation_dv_strings.rb +6 -6
- data/test/test_32_validation_dv_formula.rb +12 -12
- data/test/test_40_property_types.rb +0 -0
- data/test/test_41_properties.rb +0 -0
- data/test/test_42_set_properties.rb +0 -0
- data/test/test_50_name_stored.rb +8 -8
- data/test/test_51_name_print_area.rb +18 -18
- data/test/test_52_name_print_titles.rb +27 -27
- data/test/test_53_autofilter.rb +6 -6
- data/test/test_60_chart_generic.rb +1 -1
- data/test/test_61_chart_subclasses.rb +7 -14
- data/test/test_62_chart_formats.rb +0 -0
- data/test/test_63_chart_area_formats.rb +0 -0
- data/test/test_biff.rb +0 -0
- data/test/test_compatibility.rb +0 -0
- data/test/test_example_match.rb +31 -0
- data/test/test_format.rb +0 -0
- data/test/test_formula.rb +0 -0
- data/test/test_ole.rb +0 -0
- data/test/test_storage_lite.rb +0 -0
- data/test/test_workbook.rb +6 -0
- data/test/test_worksheet.rb +5 -5
- data/utils/add_magic_comment.rb +0 -0
- data/writeexcel.gemspec +263 -243
- data/writeexcel.rdoc +3 -3
- metadata +42 -39
data/test/test_21_escher.rb
CHANGED
@@ -37,29 +37,24 @@ class TC_escher < Test::Unit::TestCase
|
|
37
37
|
assert(true)
|
38
38
|
end
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
target = data.pop
|
45
|
-
|
46
|
-
data[3].gsub!(/ /,'')
|
47
|
-
data[3] = [data[3]].pack('H*')
|
48
|
-
|
49
|
-
caption = sprintf(" \t_add_mso_generic(): (0x%04X) %s", data[0], caption)
|
40
|
+
def test_for_store_mso_dg_container
|
41
|
+
caption = sprintf(" \t_store_mso_dg_container()")
|
42
|
+
data = [0xC8]
|
43
|
+
target = %w( 0F 00 02 F0 C8 00 00 00 ).join(' ')
|
50
44
|
|
51
|
-
|
45
|
+
result = unpack_record(@worksheet.__send__("store_mso_dg_container", *data))
|
52
46
|
|
53
|
-
|
54
|
-
end
|
47
|
+
assert_equal(target, result, caption)
|
55
48
|
end
|
56
49
|
|
57
|
-
def
|
58
|
-
caption = sprintf(" \
|
59
|
-
|
50
|
+
def test_for_store_mso_dg
|
51
|
+
caption = sprintf(" \t_store_mso_dg()")
|
52
|
+
data = [1, 2, 1025]
|
53
|
+
target = %w( 10 00 08 F0
|
54
|
+
08 00 00 00 02 00 00 00 01 04 00 00
|
55
|
+
).join(' ')
|
60
56
|
|
61
|
-
@
|
62
|
-
result = unpack_record(@workbook.store_mso_dgg_container)
|
57
|
+
result = unpack_record(@worksheet.__send__("store_mso_dg", *data))
|
63
58
|
|
64
59
|
assert_equal(target, result, caption)
|
65
60
|
end
|
@@ -72,52 +67,7 @@ class TC_escher < Test::Unit::TestCase
|
|
72
67
|
01 00 00 00 01 00 00 00 02 00 00 00
|
73
68
|
).join(' ')
|
74
69
|
|
75
|
-
result = unpack_record(@workbook.store_mso_dgg
|
76
|
-
|
77
|
-
assert_equal(target, result, caption)
|
78
|
-
end
|
79
|
-
|
80
|
-
def test_for_store_mso_opt
|
81
|
-
caption = sprintf(" \t_store_mso_opt()")
|
82
|
-
target = %w( 33 00 0B F0
|
83
|
-
12 00 00 00 BF 00 08 00 08 00 81 01 09 00 00 08
|
84
|
-
C0 01 40 00 00 08
|
85
|
-
).join(' ')
|
86
|
-
|
87
|
-
result = unpack_record(@workbook.store_mso_opt)
|
88
|
-
|
89
|
-
assert_equal(target, result, caption)
|
90
|
-
end
|
91
|
-
|
92
|
-
def test_for_store_mso_split_menu_colors
|
93
|
-
caption = sprintf(" \t_store_mso_split_menu_colors()")
|
94
|
-
target = %w( 40 00 1E F1 10 00 00 00 0D 00
|
95
|
-
00 08 0C 00 00 08 17 00 00 08 F7 00 00 10
|
96
|
-
).join(' ')
|
97
|
-
|
98
|
-
result = unpack_record(@workbook.store_mso_split_menu_colors)
|
99
|
-
|
100
|
-
assert_equal(target, result, caption)
|
101
|
-
end
|
102
|
-
|
103
|
-
def test_for_store_mso_dg_container
|
104
|
-
caption = sprintf(" \t_store_mso_dg_container()")
|
105
|
-
data = [0xC8]
|
106
|
-
target = %w( 0F 00 02 F0 C8 00 00 00 ).join(' ')
|
107
|
-
|
108
|
-
result = unpack_record(@worksheet.store_mso_dg_container(*data))
|
109
|
-
|
110
|
-
assert_equal(target, result, caption)
|
111
|
-
end
|
112
|
-
|
113
|
-
def test_for_store_mso_dg
|
114
|
-
caption = sprintf(" \t_store_mso_dg()")
|
115
|
-
data = [1, 2, 1025]
|
116
|
-
target = %w( 10 00 08 F0
|
117
|
-
08 00 00 00 02 00 00 00 01 04 00 00
|
118
|
-
).join(' ')
|
119
|
-
|
120
|
-
result = unpack_record(@worksheet.store_mso_dg(*data))
|
70
|
+
result = unpack_record(@workbook.__send__("store_mso_dgg", *data))
|
121
71
|
|
122
72
|
assert_equal(target, result, caption)
|
123
73
|
end
|
@@ -129,7 +79,7 @@ class TC_escher < Test::Unit::TestCase
|
|
129
79
|
0F 00 03 F0 B0 00 00 00
|
130
80
|
).join(' ')
|
131
81
|
|
132
|
-
result = unpack_record(@worksheet.store_mso_spgr_container
|
82
|
+
result = unpack_record(@worksheet.__send__("store_mso_spgr_container", *data))
|
133
83
|
|
134
84
|
assert_equal(target, result, caption)
|
135
85
|
end
|
@@ -141,7 +91,7 @@ class TC_escher < Test::Unit::TestCase
|
|
141
91
|
0F 00 04 F0 28 00 00 00
|
142
92
|
).join(' ')
|
143
93
|
|
144
|
-
result = unpack_record(@worksheet.store_mso_sp_container
|
94
|
+
result = unpack_record(@worksheet.__send__("store_mso_sp_container", *data))
|
145
95
|
|
146
96
|
assert_equal(target, result, caption)
|
147
97
|
end
|
@@ -153,7 +103,7 @@ class TC_escher < Test::Unit::TestCase
|
|
153
103
|
02 00 0A F0 08 00 00 00 00 04 00 00 05 00 00 00
|
154
104
|
).join(' ')
|
155
105
|
|
156
|
-
result = unpack_record(@worksheet.store_mso_sp
|
106
|
+
result = unpack_record(@worksheet.__send__("store_mso_sp", *data))
|
157
107
|
|
158
108
|
assert_equal(target, result, caption)
|
159
109
|
|
@@ -162,7 +112,7 @@ class TC_escher < Test::Unit::TestCase
|
|
162
112
|
A2 0C 0A F0 08 00 00 00 01 04 00 00 00 0A 00 00
|
163
113
|
).join(' ')
|
164
114
|
|
165
|
-
result = unpack_record(@worksheet.store_mso_sp
|
115
|
+
result = unpack_record(@worksheet.__send__("store_mso_sp", *data))
|
166
116
|
|
167
117
|
assert_equal(target, result, caption)
|
168
118
|
end
|
@@ -178,7 +128,44 @@ class TC_escher < Test::Unit::TestCase
|
|
178
128
|
03 00 03 00 BF 03 02 00 0A 00
|
179
129
|
).join(' ')
|
180
130
|
|
181
|
-
result = unpack_record(@worksheet.store_mso_opt_comment
|
131
|
+
result = unpack_record(@worksheet.__send__("store_mso_opt_comment", *data))
|
132
|
+
|
133
|
+
assert_equal(target, result, caption)
|
134
|
+
end
|
135
|
+
|
136
|
+
def test_for_store_mso_client_data
|
137
|
+
caption = sprintf(" \t_store_mso_client_data")
|
138
|
+
target = %w(
|
139
|
+
00 00 11 F0 00 00 00 00
|
140
|
+
).join(' ')
|
141
|
+
|
142
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_data"))
|
143
|
+
|
144
|
+
assert_equal(target, result, caption)
|
145
|
+
end
|
146
|
+
|
147
|
+
def test_for_store_obj_comment
|
148
|
+
caption = sprintf(" \t_store_obj_comment")
|
149
|
+
data = [0x01]
|
150
|
+
target = %w(
|
151
|
+
5D 00 34 00 15 00 12 00 19 00 01 00 11 40 00 00
|
152
|
+
00 00 00 00 00 00 00 00 00 00 0D 00 16 00 00 00
|
153
|
+
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
154
|
+
00 00 00 00 00 00 00 00
|
155
|
+
).join(' ')
|
156
|
+
|
157
|
+
result = unpack_record(@worksheet.__send__("store_obj_comment", *data))
|
158
|
+
|
159
|
+
assert_equal(target, result, caption)
|
160
|
+
end
|
161
|
+
|
162
|
+
def test_for_store_mso_client_text_box
|
163
|
+
caption = sprintf(" \t_store_mso_client_text_box")
|
164
|
+
target = %w(
|
165
|
+
00 00 0D F0 00 00 00 00
|
166
|
+
).join(' ')
|
167
|
+
|
168
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_text_box"))
|
182
169
|
|
183
170
|
assert_equal(target, result, caption)
|
184
171
|
end
|
@@ -188,134 +175,134 @@ class TC_escher < Test::Unit::TestCase
|
|
188
175
|
# A1
|
189
176
|
range = 'A1'
|
190
177
|
caption = sprintf(" \t_store_mso_client_anchor(%s)", range)
|
191
|
-
data = @worksheet.substitute_cellref
|
192
|
-
data = @worksheet.comment_params
|
178
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
179
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test')
|
193
180
|
data = data[-1]
|
194
181
|
target = %w(
|
195
182
|
00 00 10 F0 12 00 00 00 03 00 01 00 F0 00 00 00
|
196
183
|
1E 00 03 00 F0 00 04 00 78 00
|
197
184
|
).join(' ')
|
198
185
|
|
199
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
186
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
200
187
|
|
201
188
|
assert_equal(target, result, caption)
|
202
189
|
|
203
190
|
# A2
|
204
191
|
range = 'A2'
|
205
|
-
data = @worksheet.substitute_cellref
|
206
|
-
data = @worksheet.comment_params
|
192
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
193
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test')
|
207
194
|
data = data[-1]
|
208
195
|
target = %w(
|
209
196
|
00 00 10 F0 12 00 00 00 03 00 01 00 F0 00 00 00
|
210
197
|
69 00 03 00 F0 00 04 00 C4 00
|
211
198
|
).join(' ')
|
212
199
|
|
213
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
200
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
214
201
|
|
215
202
|
assert_equal(target, result, caption)
|
216
203
|
|
217
204
|
|
218
205
|
# A3
|
219
206
|
range = 'A3'
|
220
|
-
data = @worksheet.substitute_cellref
|
221
|
-
data = @worksheet.comment_params
|
207
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
208
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test')
|
222
209
|
data = data[-1]
|
223
210
|
target = %w(
|
224
211
|
00 00 10 F0 12 00 00 00 03 00 01 00 F0 00 01 00
|
225
212
|
69 00 03 00 F0 00 05 00 C4 00
|
226
213
|
).join(' ')
|
227
214
|
|
228
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
215
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
229
216
|
|
230
217
|
assert_equal(target, result, caption)
|
231
218
|
|
232
219
|
|
233
220
|
# A65534
|
234
221
|
range = 'A65534'
|
235
|
-
data = @worksheet.substitute_cellref
|
236
|
-
data = @worksheet.comment_params
|
222
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
223
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test')
|
237
224
|
data = data[-1]
|
238
225
|
target = %w(
|
239
226
|
00 00 10 F0 12 00 00 00 03 00 01 00 F0 00 F9 FF
|
240
227
|
3C 00 03 00 F0 00 FD FF 97 00
|
241
228
|
).join(' ')
|
242
229
|
|
243
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
230
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
244
231
|
|
245
232
|
assert_equal(target, result, caption)
|
246
233
|
|
247
234
|
|
248
235
|
# A65536
|
249
236
|
range = 'A65536'
|
250
|
-
data = @worksheet.substitute_cellref
|
251
|
-
data = @worksheet.comment_params
|
237
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
238
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test')
|
252
239
|
data = data[-1]
|
253
240
|
target = %w(
|
254
241
|
00 00 10 F0 12 00 00 00 03 00 01 00 F0 00 FB FF
|
255
242
|
1E 00 03 00 F0 00 FF FF 78 00
|
256
243
|
).join(' ')
|
257
244
|
|
258
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
245
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
259
246
|
|
260
247
|
assert_equal(target, result, caption)
|
261
248
|
|
262
249
|
|
263
250
|
# IT3
|
264
251
|
range = 'IT3'
|
265
|
-
data = @worksheet.substitute_cellref
|
266
|
-
data = @worksheet.comment_params
|
252
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
253
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test')
|
267
254
|
data = data[-1]
|
268
255
|
target = %w(
|
269
256
|
00 00 10 F0 12 00 00 00 03 00 FA 00 10 03 01 00
|
270
257
|
69 00 FC 00 10 03 05 00 C4 00
|
271
258
|
).join(' ')
|
272
259
|
|
273
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
260
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
274
261
|
|
275
262
|
assert_equal(target, result, caption)
|
276
263
|
|
277
264
|
|
278
265
|
# IU3
|
279
266
|
range = 'IU3'
|
280
|
-
data = @worksheet.substitute_cellref
|
281
|
-
data = @worksheet.comment_params
|
267
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
268
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test')
|
282
269
|
data = data[-1]
|
283
270
|
target = %w(
|
284
271
|
00 00 10 F0 12 00 00 00 03 00 FB 00 10 03 01 00
|
285
272
|
69 00 FD 00 10 03 05 00 C4 00
|
286
273
|
).join(' ')
|
287
274
|
|
288
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
275
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
289
276
|
|
290
277
|
assert_equal(target, result, caption)
|
291
278
|
|
292
279
|
|
293
280
|
#
|
294
281
|
range = 'IU3'
|
295
|
-
data = @worksheet.substitute_cellref
|
296
|
-
data = @worksheet.comment_params
|
282
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
283
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test')
|
297
284
|
data = data[-1]
|
298
285
|
target = %w(
|
299
286
|
00 00 10 F0 12 00 00 00 03 00 FB 00 10 03 01 00
|
300
287
|
69 00 FD 00 10 03 05 00 C4 00
|
301
288
|
).join(' ')
|
302
289
|
|
303
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
290
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
304
291
|
|
305
292
|
assert_equal(target, result, caption)
|
306
293
|
|
307
294
|
|
308
295
|
# IV3
|
309
296
|
range = 'IV3'
|
310
|
-
data = @worksheet.substitute_cellref
|
311
|
-
data = @worksheet.comment_params
|
297
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
298
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test')
|
312
299
|
data = data[-1]
|
313
300
|
target = %w(
|
314
301
|
00 00 10 F0 12 00 00 00 03 00 FC 00 10 03 01 00
|
315
302
|
69 00 FE 00 10 03 05 00 C4 00
|
316
303
|
).join(' ')
|
317
304
|
|
318
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
305
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
319
306
|
|
320
307
|
assert_equal(target, result, caption)
|
321
308
|
|
@@ -324,8 +311,8 @@ class TC_escher < Test::Unit::TestCase
|
|
324
311
|
def test_for_store_mso_client_anchor_where_comment_offsets_have_changed
|
325
312
|
range = 'A3'
|
326
313
|
caption = sprintf(" \t_store_mso_client_anchor(%s). Cell offsets changes.", range)
|
327
|
-
data = @worksheet.substitute_cellref
|
328
|
-
data = @worksheet.comment_params
|
314
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
315
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test',
|
329
316
|
:x_offset=>18, :y_offset=>9)
|
330
317
|
data = data[-1]
|
331
318
|
target = %w(
|
@@ -334,7 +321,7 @@ class TC_escher < Test::Unit::TestCase
|
|
334
321
|
05 00 E2 00
|
335
322
|
).join(' ')
|
336
323
|
|
337
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
324
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
338
325
|
|
339
326
|
assert_equal(target, result, caption)
|
340
327
|
end
|
@@ -343,8 +330,8 @@ class TC_escher < Test::Unit::TestCase
|
|
343
330
|
# x_scale, y_scale
|
344
331
|
range = 'A3'
|
345
332
|
caption = sprintf(" \t_store_mso_client_anchor(%s). Dimensions changes.", range)
|
346
|
-
data = @worksheet.substitute_cellref
|
347
|
-
data = @worksheet.comment_params
|
333
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
334
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test',
|
348
335
|
:x_scale=>3, :y_scale=>2)
|
349
336
|
data = data[-1]
|
350
337
|
target = %w(
|
@@ -352,14 +339,14 @@ class TC_escher < Test::Unit::TestCase
|
|
352
339
|
01 00 F0 00 01 00 69 00 07 00 F0 00 0A 00 1E 00
|
353
340
|
).join(' ')
|
354
341
|
|
355
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
342
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
356
343
|
|
357
344
|
assert_equal(target, result, caption)
|
358
345
|
|
359
346
|
|
360
347
|
# width, height
|
361
|
-
data = @worksheet.substitute_cellref
|
362
|
-
data = @worksheet.comment_params
|
348
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
349
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test',
|
363
350
|
:width=>384, :height=>148)
|
364
351
|
data = data[-1]
|
365
352
|
target = %w(
|
@@ -367,7 +354,7 @@ class TC_escher < Test::Unit::TestCase
|
|
367
354
|
01 00 F0 00 01 00 69 00 07 00 F0 00 0A 00 1E 00
|
368
355
|
).join(' ')
|
369
356
|
|
370
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
357
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
371
358
|
|
372
359
|
assert_equal(target, result, caption)
|
373
360
|
|
@@ -379,8 +366,8 @@ class TC_escher < Test::Unit::TestCase
|
|
379
366
|
@worksheet.set_column('G:G', 20)
|
380
367
|
|
381
368
|
caption = sprintf(" \t_store_mso_client_anchor(%s). Col width changes.", range)
|
382
|
-
data = @worksheet.substitute_cellref
|
383
|
-
data = @worksheet.comment_params
|
369
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
370
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test')
|
384
371
|
data = data[-1]
|
385
372
|
|
386
373
|
target = %w(
|
@@ -389,7 +376,7 @@ class TC_escher < Test::Unit::TestCase
|
|
389
376
|
05 00 C4 00
|
390
377
|
).join(' ')
|
391
378
|
|
392
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
379
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
393
380
|
|
394
381
|
assert_equal(target, result, caption)
|
395
382
|
|
@@ -398,8 +385,8 @@ class TC_escher < Test::Unit::TestCase
|
|
398
385
|
range = 'K3'
|
399
386
|
@worksheet.set_column('L:O', 4)
|
400
387
|
|
401
|
-
data = @worksheet.substitute_cellref
|
402
|
-
data = @worksheet.comment_params
|
388
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
389
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test')
|
403
390
|
data = data[-1]
|
404
391
|
|
405
392
|
target = %w(
|
@@ -408,7 +395,7 @@ class TC_escher < Test::Unit::TestCase
|
|
408
395
|
05 00 C4 00
|
409
396
|
).join(' ')
|
410
397
|
|
411
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
398
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
412
399
|
|
413
400
|
assert_equal(target, result, caption)
|
414
401
|
|
@@ -423,8 +410,8 @@ class TC_escher < Test::Unit::TestCase
|
|
423
410
|
@worksheet.set_row(8, 6)
|
424
411
|
|
425
412
|
caption = sprintf(" \t_store_mso_client_anchor(%s). Row height changed.", range)
|
426
|
-
data = @worksheet.substitute_cellref
|
427
|
-
data = @worksheet.comment_params
|
413
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
414
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test')
|
428
415
|
data = data[-1]
|
429
416
|
|
430
417
|
target = %w(
|
@@ -433,7 +420,7 @@ class TC_escher < Test::Unit::TestCase
|
|
433
420
|
0A 00 E2 00
|
434
421
|
).join(' ')
|
435
422
|
|
436
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
423
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
437
424
|
|
438
425
|
assert_equal(target, result, caption)
|
439
426
|
|
@@ -443,8 +430,8 @@ class TC_escher < Test::Unit::TestCase
|
|
443
430
|
@worksheet.set_row(14, 60)
|
444
431
|
|
445
432
|
caption = sprintf(" \t_store_mso_client_anchor(%s). Row height changed.", range)
|
446
|
-
data = @worksheet.substitute_cellref
|
447
|
-
data = @worksheet.comment_params
|
433
|
+
data = @worksheet.__send__("substitute_cellref", range)
|
434
|
+
data = @worksheet.__send__("comment_params", data[0], data[1], 'Test')
|
448
435
|
data = data[-1]
|
449
436
|
|
450
437
|
target = %w(
|
@@ -453,49 +440,61 @@ class TC_escher < Test::Unit::TestCase
|
|
453
440
|
0E 00 CD 00
|
454
441
|
).join(' ')
|
455
442
|
|
456
|
-
result = unpack_record(@worksheet.store_mso_client_anchor
|
443
|
+
result = unpack_record(@worksheet.__send__("store_mso_client_anchor", 3, *data))
|
457
444
|
|
458
445
|
assert_equal(target, result, caption)
|
459
446
|
|
460
447
|
end
|
461
448
|
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
449
|
+
=begin
|
450
|
+
def test_for_the_generic_method
|
451
|
+
data_for_test.each do |data|
|
452
|
+
caption = data.shift
|
453
|
+
target = data.pop
|
467
454
|
|
468
|
-
|
455
|
+
data[3].gsub!(/ /,'')
|
456
|
+
data[3] = [data[3]].pack('H*')
|
457
|
+
|
458
|
+
caption = sprintf(" \t_add_mso_generic(): (0x%04X) %s", data[0], caption)
|
459
|
+
|
460
|
+
result = unpack_record(@worksheet.add_mso_generic(*data))
|
461
|
+
|
462
|
+
assert_equal(target, result, caption)
|
463
|
+
end
|
464
|
+
end
|
465
|
+
|
466
|
+
def test_for_store_mso_dgg_container
|
467
|
+
caption = sprintf(" \t_store_mso_dgg_container()")
|
468
|
+
target = %w( 0F 00 00 F0 52 00 00 00 ).join(' ')
|
469
|
+
|
470
|
+
@workbook.mso_size = 94
|
471
|
+
result = unpack_record(@workbook.store_mso_dgg_container)
|
469
472
|
|
470
473
|
assert_equal(target, result, caption)
|
471
474
|
end
|
472
475
|
|
473
|
-
def
|
474
|
-
caption = sprintf(" \
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
00 00 00 00 00 00 00 00 00 00 0D 00 16 00 00 00
|
479
|
-
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
480
|
-
00 00 00 00 00 00 00 00
|
476
|
+
def test_for_store_mso_opt
|
477
|
+
caption = sprintf(" \t_store_mso_opt()")
|
478
|
+
target = %w( 33 00 0B F0
|
479
|
+
12 00 00 00 BF 00 08 00 08 00 81 01 09 00 00 08
|
480
|
+
C0 01 40 00 00 08
|
481
481
|
).join(' ')
|
482
482
|
|
483
|
-
result = unpack_record(@
|
483
|
+
result = unpack_record(@workbook.store_mso_opt)
|
484
484
|
|
485
485
|
assert_equal(target, result, caption)
|
486
486
|
end
|
487
487
|
|
488
|
-
def
|
489
|
-
caption = sprintf(" \
|
490
|
-
target = %w(
|
491
|
-
00 00
|
488
|
+
def test_for_store_mso_split_menu_colors
|
489
|
+
caption = sprintf(" \t_store_mso_split_menu_colors()")
|
490
|
+
target = %w( 40 00 1E F1 10 00 00 00 0D 00
|
491
|
+
00 08 0C 00 00 08 17 00 00 08 F7 00 00 10
|
492
492
|
).join(' ')
|
493
493
|
|
494
|
-
result = unpack_record(@
|
494
|
+
result = unpack_record(@workbook.store_mso_split_menu_colors)
|
495
495
|
|
496
496
|
assert_equal(target, result, caption)
|
497
497
|
end
|
498
|
-
=end
|
499
498
|
|
500
499
|
###############################################################################
|
501
500
|
#
|
@@ -633,5 +632,6 @@ class TC_escher < Test::Unit::TestCase
|
|
633
632
|
],
|
634
633
|
]
|
635
634
|
end
|
635
|
+
=end
|
636
636
|
|
637
637
|
end
|
File without changes
|
data/test/test_23_note.rb
CHANGED
@@ -26,7 +26,7 @@ class TC_note < Test::Unit::TestCase
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_blank_author_name
|
29
|
-
data = @worksheet.comment_params
|
29
|
+
data = @worksheet.__send__("comment_params", 2, 0, 'Test')
|
30
30
|
row = data[0]
|
31
31
|
col = data[1]
|
32
32
|
author = data[4]
|
@@ -39,12 +39,12 @@ class TC_note < Test::Unit::TestCase
|
|
39
39
|
1C 00 0C 00 02 00 00 00 00 00 01 00 00 00 00 00
|
40
40
|
).join(' ')
|
41
41
|
result = unpack_record(
|
42
|
-
@worksheet.store_note
|
42
|
+
@worksheet.__send__("store_note", row, col, obj_id, author, encoding, visible))
|
43
43
|
assert_equal(target, result, caption)
|
44
44
|
end
|
45
45
|
|
46
46
|
def test_defined_author_name
|
47
|
-
data = @worksheet.comment_params
|
47
|
+
data = @worksheet.__send__("comment_params", 2, 0,'Test', :author => 'Username')
|
48
48
|
row = data[0]
|
49
49
|
col = data[1]
|
50
50
|
author = data[4]
|
@@ -58,7 +58,7 @@ class TC_note < Test::Unit::TestCase
|
|
58
58
|
73 65 72 6E 61 6D 65 00
|
59
59
|
).join(' ')
|
60
60
|
result = unpack_record(
|
61
|
-
@worksheet.store_note
|
61
|
+
@worksheet.__send__("store_note", row,col,obj_id,author,encoding,visible))
|
62
62
|
assert_equal(target, result, caption)
|
63
63
|
end
|
64
64
|
|
data/test/test_24_txo.rb
CHANGED
@@ -33,7 +33,7 @@ class TC_txo < Test::Unit::TestCase
|
|
33
33
|
10 00 00 00 00 00
|
34
34
|
).join(' ')
|
35
35
|
|
36
|
-
result = unpack_record(@worksheet.store_txo
|
36
|
+
result = unpack_record(@worksheet.__send__("store_txo", string.length))
|
37
37
|
assert_equal(target, result, caption)
|
38
38
|
end
|
39
39
|
|
@@ -44,7 +44,7 @@ class TC_txo < Test::Unit::TestCase
|
|
44
44
|
3C 00 04 00 00 61 61 61
|
45
45
|
).join(' ')
|
46
46
|
|
47
|
-
result = unpack_record(@worksheet.store_txo_continue_1
|
47
|
+
result = unpack_record(@worksheet.__send__("store_txo_continue_1", string))
|
48
48
|
assert_equal(target, result, caption)
|
49
49
|
end
|
50
50
|
|
@@ -60,7 +60,7 @@ class TC_txo < Test::Unit::TestCase
|
|
60
60
|
[string.length, 0]
|
61
61
|
]
|
62
62
|
|
63
|
-
result = unpack_record(@worksheet.store_txo_continue_2
|
63
|
+
result = unpack_record(@worksheet.__send__("store_txo_continue_2", formats))
|
64
64
|
assert_equal(target, result, caption)
|
65
65
|
end
|
66
66
|
|
@@ -77,7 +77,7 @@ class TC_position_object < Test::Unit::TestCase
|
|
77
77
|
tests.each do |testcase|
|
78
78
|
input = testcase[0]
|
79
79
|
expected = testcase[1]
|
80
|
-
results = @worksheet.position_object
|
80
|
+
results = @worksheet.__send__("position_object", *input)
|
81
81
|
assert_equal(expected, results)
|
82
82
|
end
|
83
83
|
end
|
data/test/test_26_autofilter.rb
CHANGED
@@ -19,10 +19,10 @@ class TC_26_autofilter < Test::Unit::TestCase
|
|
19
19
|
@tests.each do |test|
|
20
20
|
column = test['column']
|
21
21
|
expression = test['expression']
|
22
|
-
tokens = @worksheet.extract_filter_tokens
|
23
|
-
tokens = @worksheet.parse_filter_expression
|
22
|
+
tokens = @worksheet.__send__("extract_filter_tokens", expression)
|
23
|
+
tokens = @worksheet.__send__("parse_filter_expression", expression, tokens)
|
24
24
|
|
25
|
-
result = @worksheet.store_autofilter
|
25
|
+
result = @worksheet.__send__("store_autofilter", column, *tokens)
|
26
26
|
|
27
27
|
target = test['data'].join(" ")
|
28
28
|
|
data/test/test_27_autofilter.rb
CHANGED
@@ -19,7 +19,7 @@ class TC_27_autofilter < Test::Unit::TestCase
|
|
19
19
|
@tests.each do |test|
|
20
20
|
expression = test[0]
|
21
21
|
expected = test[1]
|
22
|
-
result = @worksheet.extract_filter_tokens
|
22
|
+
result = @worksheet.__send__("extract_filter_tokens", expression)
|
23
23
|
|
24
24
|
testname = expression || 'none'
|
25
25
|
|
data/test/test_28_autofilter.rb
CHANGED
@@ -19,8 +19,8 @@ class TC_28_autofilter < Test::Unit::TestCase
|
|
19
19
|
@tests.each do |test|
|
20
20
|
expression = test[0]
|
21
21
|
expected = test[1]
|
22
|
-
tokens = @worksheet.extract_filter_tokens
|
23
|
-
result = @worksheet.parse_filter_expression
|
22
|
+
tokens = @worksheet.__send__("extract_filter_tokens", expression)
|
23
|
+
result = @worksheet.__send__("parse_filter_expression", expression, tokens)
|
24
24
|
|
25
25
|
testname = expression || 'none'
|
26
26
|
|