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
@@ -17,7 +17,7 @@ class TC_ChartGeneric < Test::Unit::TestCase
|
|
17
17
|
def setup
|
18
18
|
io = StringIO.new
|
19
19
|
workbook = WriteExcel.new(io)
|
20
|
-
@chart = Writeexcel::Chart.new('', 'chart', 0
|
20
|
+
@chart = Writeexcel::Chart.new(workbook, '', 'chart', 0)
|
21
21
|
end
|
22
22
|
|
23
23
|
def teardown
|
@@ -24,8 +24,7 @@ class TC_chart_subclasses < Test::Unit::TestCase
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_store_chart_type_of_column
|
27
|
-
chart = Writeexcel::Chart.factory('Chart::Column',
|
28
|
-
nil, nil, nil, nil)
|
27
|
+
chart = Writeexcel::Chart.factory('Chart::Column', @workbook, nil, nil, nil)
|
29
28
|
expected = %w(
|
30
29
|
17 10 06 00 00 00 96 00 00 00
|
31
30
|
).join(' ')
|
@@ -34,8 +33,7 @@ class TC_chart_subclasses < Test::Unit::TestCase
|
|
34
33
|
end
|
35
34
|
|
36
35
|
def test_store_chart_type_of_bar
|
37
|
-
chart = Writeexcel::Chart.factory('Chart::Bar',
|
38
|
-
nil, nil, nil, nil)
|
36
|
+
chart = Writeexcel::Chart.factory('Chart::Bar', @workbook, nil, nil, nil)
|
39
37
|
expected = %w(
|
40
38
|
17 10 06 00 00 00 96 00 01 00
|
41
39
|
).join(' ')
|
@@ -44,8 +42,7 @@ class TC_chart_subclasses < Test::Unit::TestCase
|
|
44
42
|
end
|
45
43
|
|
46
44
|
def test_store_chart_type_of_line
|
47
|
-
chart = Writeexcel::Chart.factory('Chart::Line',
|
48
|
-
nil, nil, nil, nil)
|
45
|
+
chart = Writeexcel::Chart.factory('Chart::Line', @workbook, nil, nil, nil)
|
49
46
|
expected = %w(
|
50
47
|
18 10 02 00 00 00
|
51
48
|
).join(' ')
|
@@ -54,8 +51,7 @@ class TC_chart_subclasses < Test::Unit::TestCase
|
|
54
51
|
end
|
55
52
|
|
56
53
|
def test_store_chart_type_of_area
|
57
|
-
chart = Writeexcel::Chart.factory('Chart::Area',
|
58
|
-
nil, nil, nil, nil)
|
54
|
+
chart = Writeexcel::Chart.factory('Chart::Area', @workbook, nil, nil, nil)
|
59
55
|
expected = %w(
|
60
56
|
1A 10 02 00 01 00
|
61
57
|
).join(' ')
|
@@ -64,8 +60,7 @@ class TC_chart_subclasses < Test::Unit::TestCase
|
|
64
60
|
end
|
65
61
|
|
66
62
|
def test_store_chart_type_of_pie
|
67
|
-
chart = Writeexcel::Chart.factory('Chart::Pie',
|
68
|
-
nil, nil, nil, nil)
|
63
|
+
chart = Writeexcel::Chart.factory('Chart::Pie', @workbook, nil, nil, nil)
|
69
64
|
expected = %w(
|
70
65
|
19 10 06 00 00 00 00 00 02 00
|
71
66
|
).join(' ')
|
@@ -74,8 +69,7 @@ class TC_chart_subclasses < Test::Unit::TestCase
|
|
74
69
|
end
|
75
70
|
|
76
71
|
def test_store_chart_type_of_scatter
|
77
|
-
chart = Writeexcel::Chart.factory('Chart::Scatter',
|
78
|
-
nil, nil, nil, nil)
|
72
|
+
chart = Writeexcel::Chart.factory('Chart::Scatter', @workbook, nil, nil, nil)
|
79
73
|
expected = %w(
|
80
74
|
1B 10 06 00 64 00 01 00 00 00
|
81
75
|
).join(' ')
|
@@ -84,8 +78,7 @@ class TC_chart_subclasses < Test::Unit::TestCase
|
|
84
78
|
end
|
85
79
|
|
86
80
|
def test_store_chart_type_of_stock
|
87
|
-
chart = Writeexcel::Chart.factory('Chart::Stock',
|
88
|
-
nil, nil, nil, nil)
|
81
|
+
chart = Writeexcel::Chart.factory('Chart::Stock', @workbook, nil, nil, nil)
|
89
82
|
expected = %w(
|
90
83
|
18 10 02 00 00 00
|
91
84
|
).join(' ')
|
File without changes
|
File without changes
|
data/test/test_biff.rb
CHANGED
File without changes
|
data/test/test_compatibility.rb
CHANGED
File without changes
|
data/test/test_example_match.rb
CHANGED
@@ -3141,4 +3141,35 @@ workbook.close
|
|
3141
3141
|
# do assertion
|
3142
3142
|
compare_file("#{PERL_OUTDIR}/utf8.xls", @file)
|
3143
3143
|
end
|
3144
|
+
|
3145
|
+
def test_hide_zero
|
3146
|
+
workbook = WriteExcel.new(@file)
|
3147
|
+
worksheet = workbook.add_worksheet
|
3148
|
+
worksheet.write(0, 0, 'C2, E2 value is zero, not displayed')
|
3149
|
+
worksheet.write(1, 0, 1)
|
3150
|
+
worksheet.write(1, 1, 2)
|
3151
|
+
worksheet.write(1, 2, 0)
|
3152
|
+
worksheet.write(1, 3, 4)
|
3153
|
+
worksheet.write(1, 4, 0)
|
3154
|
+
|
3155
|
+
worksheet.hide_zero
|
3156
|
+
workbook.close
|
3157
|
+
|
3158
|
+
# do assertion
|
3159
|
+
compare_file("#{PERL_OUTDIR}/hide_zero.xls", @file)
|
3160
|
+
end
|
3161
|
+
|
3162
|
+
def test_set_first_sheet
|
3163
|
+
workbook = WriteExcel.new(@file)
|
3164
|
+
20.times { workbook.add_worksheet }
|
3165
|
+
worksheet21 = workbook.add_worksheet
|
3166
|
+
worksheet22 = workbook.add_worksheet
|
3167
|
+
|
3168
|
+
worksheet21.set_first_sheet
|
3169
|
+
worksheet22.activate
|
3170
|
+
workbook.close
|
3171
|
+
|
3172
|
+
# do assertion
|
3173
|
+
compare_file("#{PERL_OUTDIR}/set_first_sheet.xls", @file)
|
3174
|
+
end
|
3144
3175
|
end
|
data/test/test_format.rb
CHANGED
File without changes
|
data/test/test_formula.rb
CHANGED
File without changes
|
data/test/test_ole.rb
CHANGED
File without changes
|
data/test/test_storage_lite.rb
CHANGED
File without changes
|
data/test/test_workbook.rb
CHANGED
@@ -71,6 +71,12 @@ class TC_Workbook < Test::Unit::TestCase
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
+
def test_check_sheetname_raise_if_same_utf16be_sheet_name
|
75
|
+
smily = [0x263a].pack('n')
|
76
|
+
@workbook.add_worksheet(smily, true)
|
77
|
+
assert_raise(RuntimeError) { @workbook.add_worksheet(smily, true)}
|
78
|
+
end
|
79
|
+
|
74
80
|
def test_check_sheetname_utf8_only
|
75
81
|
['Лист 1', 'Лист 2', 'Лист 3'].each do |sheetname|
|
76
82
|
assert_nothing_raised { @workbook.add_worksheet(sheetname) }
|
data/test/test_worksheet.rb
CHANGED
@@ -47,7 +47,7 @@ class TC_Worksheet < Test::Unit::TestCase
|
|
47
47
|
|
48
48
|
def test_store_dimensions
|
49
49
|
file = "delete_this"
|
50
|
-
File.open(file,"w+"){ |f| f.print @ws.store_dimensions }
|
50
|
+
File.open(file,"w+"){ |f| f.print @ws.__send__("store_dimensions") }
|
51
51
|
pf = @perldir + "ws_store_dimensions"
|
52
52
|
p_od = IO.readlines(pf).to_s.dump
|
53
53
|
r_od = IO.readlines(file).to_s.dump
|
@@ -58,7 +58,7 @@ class TC_Worksheet < Test::Unit::TestCase
|
|
58
58
|
|
59
59
|
def test_store_colinfo
|
60
60
|
file = "delete_this"
|
61
|
-
File.open(file,"w+"){ |f| f.print @ws.store_colinfo }
|
61
|
+
File.open(file,"w+"){ |f| f.print @ws.__send__("store_colinfo") }
|
62
62
|
pf = @perldir + "ws_store_colinfo"
|
63
63
|
p_od = IO.readlines(pf).to_s.dump
|
64
64
|
r_od = IO.readlines(file).to_s.dump
|
@@ -69,7 +69,7 @@ class TC_Worksheet < Test::Unit::TestCase
|
|
69
69
|
|
70
70
|
def test_store_selection
|
71
71
|
file = "delete_this"
|
72
|
-
File.open(file,"w+"){ |f| f.print @ws.store_selection
|
72
|
+
File.open(file,"w+"){ |f| f.print @ws.__send__("store_selection", 1,1,2,2) }
|
73
73
|
pf = @perldir + "ws_store_selection"
|
74
74
|
p_od = IO.readlines(pf).to_s.dump
|
75
75
|
r_od = IO.readlines(file).to_s.dump
|
@@ -80,7 +80,7 @@ class TC_Worksheet < Test::Unit::TestCase
|
|
80
80
|
|
81
81
|
def test_store_filtermode
|
82
82
|
file = "delete_this"
|
83
|
-
File.open(file,"w+"){ |f| f.print @ws.store_filtermode }
|
83
|
+
File.open(file,"w+"){ |f| f.print @ws.__send__("store_filtermode") }
|
84
84
|
pf = @perldir + "ws_store_filtermode_off"
|
85
85
|
p_od = IO.readlines(pf).to_s.dump
|
86
86
|
r_od = IO.readlines(file).to_s.dump
|
@@ -90,7 +90,7 @@ class TC_Worksheet < Test::Unit::TestCase
|
|
90
90
|
|
91
91
|
@ws.autofilter(1,1,2,2)
|
92
92
|
@ws.filter_column(1, 'x < 2000')
|
93
|
-
File.open(file,"w+"){ |f| f.print @ws.store_filtermode }
|
93
|
+
File.open(file,"w+"){ |f| f.print @ws.__send__("store_filtermode") }
|
94
94
|
pf = @perldir + "ws_store_filtermode_on"
|
95
95
|
p_od = IO.readlines(pf).to_s.dump
|
96
96
|
r_od = IO.readlines(file).to_s.dump
|
data/utils/add_magic_comment.rb
CHANGED
File without changes
|