write_xlsx 0.85.9 → 1.09.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +53 -1
- data/Changes +242 -0
- data/LICENSE.txt +1 -1
- data/README.md +5 -5
- data/examples/a_simple.rb +2 -7
- data/examples/add_vba_project.rb +1 -1
- data/examples/array_formula.rb +1 -1
- data/examples/background.rb +19 -0
- data/examples/chart_area.rb +5 -2
- data/examples/chart_bar.rb +5 -2
- data/examples/chart_clustered.rb +1 -1
- data/examples/chart_column.rb +5 -2
- data/examples/chart_combined.rb +4 -2
- data/examples/chart_data_labels.rb +320 -0
- data/examples/chart_data_table.rb +9 -3
- data/examples/chart_data_tools.rb +25 -7
- data/examples/chart_doughnut.rb +17 -5
- data/examples/chart_gauge.rb +73 -0
- data/examples/chart_line.rb +90 -12
- data/examples/chart_pareto.rb +1 -1
- data/examples/chart_pie.rb +9 -3
- data/examples/chart_radar.rb +13 -4
- data/examples/chart_scatter.rb +5 -2
- data/examples/chart_secondary_axis.rb +5 -2
- data/examples/chart_stock.rb +1 -1
- data/examples/chart_styles.rb +1 -1
- data/examples/colors.rb +48 -1
- data/examples/comments2.rb +1 -1
- data/examples/conditional_format.rb +79 -1
- data/examples/data_validate.rb +8 -8
- data/examples/date_time.rb +1 -1
- data/examples/demo.rb +5 -8
- data/examples/formats.rb +1 -1
- data/examples/headers.rb +1 -1
- data/examples/hide_row_col.rb +1 -1
- data/examples/hide_sheet.rb +1 -1
- data/examples/hyperlink1.rb +5 -12
- data/examples/ignore_errors.rb +39 -0
- data/examples/indent.rb +1 -1
- data/examples/keep_leading_zeros.rb +17 -0
- data/examples/macros.rb +1 -1
- data/examples/merge1.rb +1 -1
- data/examples/merge2.rb +1 -1
- data/examples/merge3.rb +1 -1
- data/examples/merge4.rb +1 -1
- data/examples/merge5.rb +1 -1
- data/examples/merge6.rb +1 -1
- data/examples/outline.rb +1 -1
- data/examples/outline_collapsed.rb +1 -1
- data/examples/panes.rb +2 -2
- data/examples/properties.rb +1 -1
- data/examples/regions.rb +1 -1
- data/examples/rich_strings.rb +1 -1
- data/examples/right_to_left.rb +1 -1
- data/examples/shape1.rb +1 -1
- data/examples/shape2.rb +1 -1
- data/examples/shape3.rb +1 -1
- data/examples/shape4.rb +1 -1
- data/examples/shape5.rb +1 -1
- data/examples/shape6.rb +1 -1
- data/examples/shape7.rb +1 -1
- data/examples/shape8.rb +1 -1
- data/examples/shape_all.rb +1 -1
- data/examples/sparklines1.rb +1 -1
- data/examples/sparklines2.rb +1 -1
- data/examples/stats.rb +1 -1
- data/examples/stats_ext.rb +1 -1
- data/examples/stocks.rb +1 -1
- data/examples/tab_colors.rb +2 -2
- data/examples/tables.rb +78 -43
- data/examples/update_range_format_with_params.rb +33 -0
- data/lib/write_xlsx/chart/area.rb +1 -1
- data/lib/write_xlsx/chart/axis.rb +37 -12
- data/lib/write_xlsx/chart/bar.rb +1 -1
- data/lib/write_xlsx/chart/caption.rb +3 -1
- data/lib/write_xlsx/chart/column.rb +1 -1
- data/lib/write_xlsx/chart/doughnut.rb +1 -1
- data/lib/write_xlsx/chart/legend.rb +14 -0
- data/lib/write_xlsx/chart/line.rb +16 -2
- data/lib/write_xlsx/chart/pie.rb +32 -15
- data/lib/write_xlsx/chart/radar.rb +1 -1
- data/lib/write_xlsx/chart/scatter.rb +1 -16
- data/lib/write_xlsx/chart/series.rb +138 -18
- data/lib/write_xlsx/chart/stock.rb +1 -1
- data/lib/write_xlsx/chart.rb +365 -277
- data/lib/write_xlsx/chartsheet.rb +38 -10
- data/lib/write_xlsx/drawing.rb +190 -71
- data/lib/write_xlsx/format.rb +41 -201
- data/lib/write_xlsx/package/app.rb +17 -5
- data/lib/write_xlsx/package/button.rb +8 -8
- data/lib/write_xlsx/package/comments.rb +73 -68
- data/lib/write_xlsx/package/conditional_format.rb +367 -46
- data/lib/write_xlsx/package/content_types.rb +28 -9
- data/lib/write_xlsx/package/core.rb +13 -11
- data/lib/write_xlsx/package/custom.rb +125 -0
- data/lib/write_xlsx/package/metadata.rb +159 -0
- data/lib/write_xlsx/package/packager.rb +48 -0
- data/lib/write_xlsx/package/relationships.rb +4 -4
- data/lib/write_xlsx/package/shared_strings.rb +6 -6
- data/lib/write_xlsx/package/styles.rb +102 -39
- data/lib/write_xlsx/package/table.rb +83 -36
- data/lib/write_xlsx/package/theme.rb +1 -1
- data/lib/write_xlsx/package/vml.rb +63 -62
- data/lib/write_xlsx/package/xml_writer_simple.rb +3 -2
- data/lib/write_xlsx/shape.rb +21 -18
- data/lib/write_xlsx/sheets.rb +18 -16
- data/lib/write_xlsx/sparkline.rb +341 -341
- data/lib/write_xlsx/utility.rb +414 -53
- data/lib/write_xlsx/version.rb +1 -1
- data/lib/write_xlsx/workbook.rb +396 -699
- data/lib/write_xlsx/worksheet/cell_data.rb +46 -3
- data/lib/write_xlsx/worksheet/data_validation.rb +53 -50
- data/lib/write_xlsx/worksheet/hyperlink.rb +29 -50
- data/lib/write_xlsx/worksheet/page_setup.rb +12 -12
- data/lib/write_xlsx/worksheet.rb +1043 -4366
- data/test/chart/test_add_series.rb +11 -1
- data/test/chart/test_process_names.rb +1 -1
- data/test/chart/test_write_a_latin.rb +1 -1
- data/test/chart/test_write_auto.rb +1 -1
- data/test/chart/test_write_ax_id.rb +1 -1
- data/test/chart/test_write_ax_pos.rb +1 -1
- data/test/chart/test_write_cross_ax.rb +1 -1
- data/test/chart/test_write_crosses.rb +1 -1
- data/test/chart/test_write_d_lbls.rb +1 -1
- data/test/chart/test_write_format_code.rb +1 -1
- data/test/chart/test_write_idx.rb +1 -1
- data/test/chart/test_write_label_align.rb +1 -1
- data/test/chart/test_write_label_offset.rb +1 -1
- data/test/chart/test_write_lang.rb +1 -1
- data/test/chart/test_write_layout.rb +1 -1
- data/test/chart/test_write_legend.rb +1 -1
- data/test/chart/test_write_legend_pos.rb +10 -2
- data/test/chart/test_write_major_gridlines.rb +1 -1
- data/test/chart/test_write_marker.rb +1 -1
- data/test/chart/test_write_marker_size.rb +1 -1
- data/test/chart/test_write_marker_value.rb +1 -1
- data/test/chart/test_write_num_cache.rb +1 -1
- data/test/chart/test_write_number_format.rb +2 -3
- data/test/chart/test_write_order.rb +1 -1
- data/test/chart/test_write_orientation.rb +1 -1
- data/test/chart/test_write_page_margins.rb +1 -1
- data/test/chart/test_write_page_setup.rb +1 -1
- data/test/chart/test_write_plot_vis_only.rb +1 -1
- data/test/chart/test_write_pt.rb +1 -1
- data/test/chart/test_write_pt_count.rb +1 -1
- data/test/chart/test_write_series_formula.rb +1 -1
- data/test/chart/test_write_style.rb +1 -1
- data/test/chart/test_write_symbol.rb +1 -1
- data/test/chart/test_write_tick_lbl_pos.rb +1 -1
- data/test/chart/test_write_v.rb +1 -1
- data/test/chartsheet/test_chartsheet01.rb +1 -1
- data/test/chartsheet/test_write_sheet_protection.rb +91 -0
- data/test/drawing/test_drawing_chart_01.rb +7 -3
- data/test/drawing/test_drawing_image_01.rb +13 -4
- data/test/drawing/test_drawing_shape_01.rb +9 -6
- data/test/drawing/test_drawing_shape_02.rb +13 -6
- data/test/drawing/test_drawing_shape_03.rb +9 -6
- data/test/drawing/test_drawing_shape_04.rb +9 -25
- data/test/drawing/test_drawing_shape_05.rb +9 -6
- data/test/drawing/test_drawing_shape_06.rb +12 -7
- data/test/drawing/test_drawing_shape_07.rb +12 -7
- data/test/drawing/test_write_a_graphic_frame_locks.rb +2 -2
- data/test/drawing/test_write_c_chart.rb +2 -2
- data/test/drawing/test_write_c_nv_graphic_frame_pr.rb +2 -2
- data/test/drawing/test_write_c_nv_pr.rb +2 -2
- data/test/drawing/test_write_col.rb +2 -2
- data/test/drawing/test_write_col_off.rb +2 -2
- data/test/drawing/test_write_pos.rb +2 -2
- data/test/drawing/test_write_row.rb +2 -2
- data/test/drawing/test_write_row_off.rb +2 -2
- data/test/drawing/{test_write_ext.rb → test_write_xdr_ext.rb} +3 -3
- data/test/drawing/test_write_xfrm_extension.rb +2 -2
- data/test/drawing/test_write_xfrm_offset.rb +2 -2
- data/test/helper.rb +8 -3
- data/test/package/app/test_app01.rb +1 -1
- data/test/package/app/test_app02.rb +1 -1
- data/test/package/app/test_app03.rb +1 -1
- data/test/package/comments/test_comments_01.rb +54 -0
- data/test/package/comments/test_comments_02.rb +54 -0
- data/test/package/content_types/test_content_types.rb +1 -1
- data/test/package/content_types/test_write_default.rb +1 -1
- data/test/package/content_types/test_write_override.rb +1 -1
- data/test/package/core/test_core01.rb +1 -1
- data/test/package/core/test_core02.rb +1 -1
- data/test/package/relationships/test_relationships.rb +1 -1
- data/test/package/relationships/test_sheet_rels.rb +1 -1
- data/test/package/shared_strings/test_shared_strings01.rb +1 -1
- data/test/package/shared_strings/test_shared_strings02.rb +1 -1
- data/test/package/shared_strings/test_write_si.rb +1 -7
- data/test/package/styles/test_styles_01.rb +1 -1
- data/test/package/styles/test_styles_02.rb +1 -1
- data/test/package/styles/test_styles_03.rb +1 -1
- data/test/package/styles/test_styles_04.rb +1 -1
- data/test/package/styles/test_styles_05.rb +1 -1
- data/test/package/styles/test_styles_06.rb +1 -1
- data/test/package/styles/test_styles_07.rb +1 -1
- data/test/package/styles/test_styles_08.rb +1 -1
- data/test/package/styles/test_styles_09.rb +1 -1
- data/test/package/table/test_table01.rb +3 -3
- data/test/package/table/test_table02.rb +2 -2
- data/test/package/table/test_table03.rb +2 -2
- data/test/package/table/test_table04.rb +2 -2
- data/test/package/table/test_table05.rb +2 -2
- data/test/package/table/test_table06.rb +2 -2
- data/test/package/table/test_table07.rb +2 -2
- data/test/package/table/test_table08.rb +2 -2
- data/test/package/table/test_table09.rb +2 -2
- data/test/package/table/test_table10.rb +2 -2
- data/test/package/table/test_table11.rb +2 -2
- data/test/package/table/test_table12.rb +2 -2
- data/test/package/table/test_table13.rb +1 -1
- data/test/package/table/test_write_auto_filter.rb +1 -1
- data/test/package/table/test_write_table_column.rb +1 -1
- data/test/package/table/test_write_table_style_info.rb +1 -1
- data/test/package/vml/test_write_auto_fill.rb +1 -1
- data/test/package/vml/test_write_div.rb +1 -1
- data/test/package/vml/test_write_idmap.rb +1 -1
- data/test/package/vml/test_write_path.rb +1 -1
- data/test/package/vml/test_write_shapelayout.rb +1 -1
- data/test/package/vml/test_write_shapetype.rb +1 -1
- data/test/package/vml/test_write_stroke.rb +1 -1
- data/test/perl_output/background.xlsx +0 -0
- data/test/perl_output/chart_data_labels.xlsx +0 -0
- data/test/perl_output/chart_gauge.xlsx +0 -0
- data/test/perl_output/chart_line.xlsx +0 -0
- data/test/perl_output/comments2.xlsx +0 -0
- data/test/perl_output/formats.xlsx +0 -0
- data/test/perl_output/ignore_errors.xlsx +0 -0
- data/test/perl_output/keep_leading_zeros.xlsx +0 -0
- data/test/perl_output/multi_line.xlsx +0 -0
- data/test/perl_output/tables.xlsx +0 -0
- data/test/regression/_test_hyperlink31.rb +26 -0
- data/test/regression/disabled_test_vml04.rb +1 -1
- data/test/regression/images/happy.jpg +0 -0
- data/test/regression/images/logo.gif +0 -0
- data/test/regression/images/logo.jpg +0 -0
- data/test/regression/images/red.gif +0 -0
- data/test/regression/images/red2.png +0 -0
- data/test/regression/images/red_208.png +0 -0
- data/test/regression/images/zero_dpi.jpg +0 -0
- data/test/regression/test_array_formula01.rb +1 -1
- data/test/regression/test_array_formula02.rb +1 -1
- data/test/regression/test_array_formula03.rb +36 -0
- data/test/regression/test_array_formula04.rb +31 -0
- data/test/regression/test_autofilter00.rb +1 -1
- data/test/regression/test_autofilter01.rb +1 -1
- data/test/regression/test_autofilter02.rb +1 -1
- data/test/regression/test_autofilter03.rb +1 -1
- data/test/regression/test_autofilter04.rb +1 -1
- data/test/regression/test_autofilter05.rb +1 -1
- data/test/regression/test_autofilter06.rb +1 -1
- data/test/regression/test_autofilter07.rb +1 -1
- data/test/regression/test_autofilter08.rb +110 -0
- data/test/regression/test_autofilter09.rb +110 -0
- data/test/regression/test_autofilter10.rb +110 -0
- data/test/regression/test_background01.rb +23 -0
- data/test/regression/test_background02.rb +23 -0
- data/test/regression/test_background03.rb +24 -0
- data/test/regression/test_background04.rb +25 -0
- data/test/regression/test_background05.rb +25 -0
- data/test/regression/test_background06.rb +31 -0
- data/test/regression/test_background07.rb +37 -0
- data/test/regression/test_button01.rb +1 -1
- data/test/regression/test_button02.rb +1 -1
- data/test/regression/test_button03.rb +1 -1
- data/test/regression/test_button04.rb +1 -1
- data/test/regression/test_button05.rb +1 -1
- data/test/regression/test_button06.rb +1 -1
- data/test/regression/test_button07.rb +1 -1
- data/test/regression/test_button08.rb +1 -1
- data/test/regression/test_button13.rb +1 -1
- data/test/regression/test_button14.rb +1 -1
- data/test/regression/test_chart_area01.rb +1 -1
- data/test/regression/test_chart_area02.rb +1 -1
- data/test/regression/test_chart_area03.rb +1 -1
- data/test/regression/test_chart_area04.rb +1 -1
- data/test/regression/test_chart_axis01.rb +1 -1
- data/test/regression/test_chart_axis02.rb +1 -1
- data/test/regression/test_chart_axis03.rb +1 -1
- data/test/regression/test_chart_axis04.rb +1 -1
- data/test/regression/test_chart_axis05.rb +1 -1
- data/test/regression/test_chart_axis06.rb +1 -1
- data/test/regression/test_chart_axis07.rb +1 -1
- data/test/regression/test_chart_axis08.rb +1 -1
- data/test/regression/test_chart_axis09.rb +1 -1
- data/test/regression/test_chart_axis10.rb +1 -1
- data/test/regression/test_chart_axis11.rb +1 -1
- data/test/regression/test_chart_axis12.rb +1 -1
- data/test/regression/test_chart_axis13.rb +1 -1
- data/test/regression/test_chart_axis14.rb +1 -1
- data/test/regression/test_chart_axis15.rb +1 -1
- data/test/regression/test_chart_axis16.rb +1 -1
- data/test/regression/test_chart_axis17.rb +1 -1
- data/test/regression/test_chart_axis18.rb +1 -1
- data/test/regression/test_chart_axis19.rb +1 -1
- data/test/regression/test_chart_axis20.rb +1 -1
- data/test/regression/test_chart_axis21.rb +1 -1
- data/test/regression/test_chart_axis22.rb +1 -1
- data/test/regression/test_chart_axis23.rb +1 -1
- data/test/regression/test_chart_axis24.rb +1 -1
- data/test/regression/test_chart_axis25.rb +1 -1
- data/test/regression/test_chart_axis26.rb +11 -9
- data/test/regression/test_chart_axis27.rb +2 -2
- data/test/regression/test_chart_axis28.rb +2 -2
- data/test/regression/test_chart_axis29.rb +2 -2
- data/test/regression/test_chart_axis30.rb +1 -1
- data/test/regression/test_chart_axis31.rb +1 -1
- data/test/regression/test_chart_axis32.rb +1 -1
- data/test/regression/test_chart_axis33.rb +2 -2
- data/test/regression/test_chart_axis34.rb +1 -1
- data/test/regression/test_chart_axis35.rb +1 -1
- data/test/regression/test_chart_axis36.rb +1 -1
- data/test/regression/test_chart_axis37.rb +1 -1
- data/test/regression/test_chart_axis38.rb +1 -1
- data/test/regression/test_chart_axis39.rb +1 -1
- data/test/regression/test_chart_axis40.rb +44 -0
- data/test/regression/test_chart_axis41.rb +48 -0
- data/test/regression/test_chart_axis42.rb +44 -0
- data/test/regression/test_chart_axis43.rb +44 -0
- data/test/regression/test_chart_axis44.rb +54 -0
- data/test/regression/test_chart_axis45.rb +54 -0
- data/test/regression/test_chart_axis46.rb +54 -0
- data/test/regression/test_chart_axis47.rb +52 -0
- data/test/regression/test_chart_axis48.rb +53 -0
- data/test/regression/test_chart_bar01.rb +1 -1
- data/test/regression/test_chart_bar02.rb +1 -1
- data/test/regression/test_chart_bar03.rb +1 -1
- data/test/regression/test_chart_bar04.rb +1 -1
- data/test/regression/test_chart_bar05.rb +1 -1
- data/test/regression/test_chart_bar06.rb +1 -1
- data/test/regression/test_chart_bar07.rb +1 -1
- data/test/regression/test_chart_bar08.rb +4 -1
- data/test/regression/test_chart_bar09.rb +1 -1
- data/test/regression/test_chart_bar10.rb +1 -1
- data/test/regression/test_chart_bar11.rb +4 -1
- data/test/regression/test_chart_bar12.rb +1 -1
- data/test/regression/test_chart_bar13.rb +1 -1
- data/test/regression/test_chart_bar14.rb +4 -1
- data/test/regression/test_chart_bar15.rb +1 -1
- data/test/regression/test_chart_bar16.rb +1 -1
- data/test/regression/test_chart_bar17.rb +1 -1
- data/test/regression/test_chart_bar18.rb +1 -1
- data/test/regression/test_chart_bar19.rb +1 -1
- data/test/regression/test_chart_bar20.rb +1 -1
- data/test/regression/test_chart_bar21.rb +1 -1
- data/test/regression/test_chart_bar22.rb +1 -1
- data/test/regression/test_chart_bar23.rb +1 -1
- data/test/regression/test_chart_bar24.rb +1 -1
- data/test/regression/test_chart_blank01.rb +1 -1
- data/test/regression/test_chart_blank02.rb +1 -1
- data/test/regression/test_chart_blank03.rb +1 -1
- data/test/regression/test_chart_blank04.rb +1 -1
- data/test/regression/test_chart_blank05.rb +1 -1
- data/test/regression/test_chart_blank06.rb +1 -1
- data/test/regression/test_chart_chartarea01.rb +1 -1
- data/test/regression/test_chart_chartarea02.rb +1 -1
- data/test/regression/test_chart_chartarea03.rb +1 -1
- data/test/regression/test_chart_chartarea04.rb +1 -1
- data/test/regression/test_chart_chartarea05.rb +17 -18
- data/test/regression/test_chart_chartarea06.rb +49 -0
- data/test/regression/test_chart_clustered01.rb +1 -1
- data/test/regression/test_chart_column01.rb +1 -1
- data/test/regression/test_chart_column02.rb +1 -1
- data/test/regression/test_chart_column03.rb +1 -1
- data/test/regression/test_chart_column04.rb +1 -1
- data/test/regression/test_chart_column05.rb +1 -1
- data/test/regression/test_chart_column06.rb +1 -1
- data/test/regression/test_chart_column07.rb +1 -1
- data/test/regression/test_chart_column08.rb +1 -1
- data/test/regression/test_chart_column09.rb +1 -1
- data/test/regression/test_chart_column10.rb +1 -1
- data/test/regression/test_chart_column11.rb +1 -1
- data/test/regression/test_chart_column12.rb +1 -1
- data/test/regression/test_chart_combined01.rb +1 -1
- data/test/regression/test_chart_combined02.rb +1 -1
- data/test/regression/test_chart_combined03.rb +1 -1
- data/test/regression/test_chart_combined04.rb +1 -1
- data/test/regression/test_chart_combined05.rb +1 -1
- data/test/regression/test_chart_combined06.rb +1 -1
- data/test/regression/test_chart_combined07.rb +1 -1
- data/test/regression/test_chart_combined08.rb +1 -1
- data/test/regression/test_chart_combined09.rb +50 -0
- data/test/regression/test_chart_combined10.rb +43 -0
- data/test/regression/test_chart_combined11.rb +63 -0
- data/test/regression/test_chart_crossing01.rb +2 -2
- data/test/regression/test_chart_crossing02.rb +1 -1
- data/test/regression/test_chart_crossing03.rb +1 -1
- data/test/regression/test_chart_crossing04.rb +1 -1
- data/test/regression/test_chart_crossing05.rb +46 -0
- data/test/regression/test_chart_crossing06.rb +46 -0
- data/test/regression/test_chart_data_labels01.rb +1 -1
- data/test/regression/test_chart_data_labels02.rb +1 -1
- data/test/regression/test_chart_data_labels03.rb +1 -1
- data/test/regression/test_chart_data_labels04.rb +1 -1
- data/test/regression/test_chart_data_labels05.rb +1 -1
- data/test/regression/test_chart_data_labels06.rb +1 -1
- data/test/regression/test_chart_data_labels07.rb +1 -1
- data/test/regression/test_chart_data_labels08.rb +1 -1
- data/test/regression/test_chart_data_labels09.rb +1 -1
- data/test/regression/test_chart_data_labels10.rb +1 -1
- data/test/regression/test_chart_data_labels11.rb +1 -1
- data/test/regression/test_chart_data_labels12.rb +1 -1
- data/test/regression/test_chart_data_labels13.rb +1 -1
- data/test/regression/test_chart_data_labels14.rb +1 -1
- data/test/regression/test_chart_data_labels15.rb +1 -1
- data/test/regression/test_chart_data_labels16.rb +1 -1
- data/test/regression/test_chart_data_labels17.rb +1 -1
- data/test/regression/test_chart_data_labels18.rb +1 -1
- data/test/regression/test_chart_data_labels19.rb +1 -1
- data/test/regression/test_chart_data_labels20.rb +1 -1
- data/test/regression/test_chart_data_labels21.rb +1 -1
- data/test/regression/test_chart_data_labels22.rb +1 -1
- data/test/regression/test_chart_data_labels23.rb +1 -1
- data/test/regression/test_chart_data_labels24.rb +1 -1
- data/test/regression/test_chart_data_labels25.rb +61 -0
- data/test/regression/test_chart_data_labels26.rb +44 -0
- data/test/regression/test_chart_data_labels27.rb +44 -0
- data/test/regression/test_chart_data_labels28.rb +52 -0
- data/test/regression/test_chart_data_labels29.rb +43 -0
- data/test/regression/test_chart_data_labels30.rb +46 -0
- data/test/regression/test_chart_data_labels31.rb +49 -0
- data/test/regression/test_chart_data_labels32.rb +54 -0
- data/test/regression/test_chart_data_labels33.rb +52 -0
- data/test/regression/test_chart_data_labels34.rb +54 -0
- data/test/regression/test_chart_data_labels35.rb +46 -0
- data/test/regression/test_chart_data_labels36.rb +54 -0
- data/test/regression/test_chart_data_labels37.rb +51 -0
- data/test/regression/test_chart_data_labels38.rb +54 -0
- data/test/regression/test_chart_data_labels39.rb +53 -0
- data/test/regression/test_chart_data_labels40.rb +53 -0
- data/test/regression/test_chart_data_labels41.rb +54 -0
- data/test/regression/test_chart_data_labels42.rb +58 -0
- data/test/regression/test_chart_data_labels43.rb +58 -0
- data/test/regression/test_chart_data_labels44.rb +56 -0
- data/test/regression/test_chart_data_labels45.rb +57 -0
- data/test/regression/test_chart_data_labels46.rb +61 -0
- data/test/regression/test_chart_data_labels47.rb +61 -0
- data/test/regression/test_chart_data_labels48.rb +55 -0
- data/test/regression/test_chart_data_labels49.rb +55 -0
- data/test/regression/test_chart_data_labels50.rb +57 -0
- data/test/regression/test_chart_date01.rb +1 -1
- data/test/regression/test_chart_date02.rb +1 -1
- data/test/regression/test_chart_date03.rb +1 -1
- data/test/regression/test_chart_date04.rb +1 -1
- data/test/regression/test_chart_date05.rb +1 -1
- data/test/regression/test_chart_display_units01.rb +1 -1
- data/test/regression/test_chart_display_units02.rb +1 -1
- data/test/regression/test_chart_display_units03.rb +1 -1
- data/test/regression/test_chart_display_units04.rb +1 -1
- data/test/regression/test_chart_display_units05.rb +1 -1
- data/test/regression/test_chart_display_units06.rb +1 -1
- data/test/regression/test_chart_display_units07.rb +1 -1
- data/test/regression/test_chart_display_units08.rb +1 -1
- data/test/regression/test_chart_display_units09.rb +1 -1
- data/test/regression/test_chart_display_units10.rb +1 -1
- data/test/regression/test_chart_display_units11.rb +1 -1
- data/test/regression/test_chart_display_units12.rb +1 -1
- data/test/regression/test_chart_doughnut01.rb +1 -1
- data/test/regression/test_chart_doughnut02.rb +1 -1
- data/test/regression/test_chart_doughnut03.rb +1 -1
- data/test/regression/test_chart_doughnut04.rb +1 -1
- data/test/regression/test_chart_doughnut05.rb +1 -1
- data/test/regression/test_chart_doughnut06.rb +1 -1
- data/test/regression/test_chart_doughnut07.rb +37 -0
- data/test/regression/test_chart_drop_lines01.rb +1 -1
- data/test/regression/test_chart_drop_lines02.rb +1 -1
- data/test/regression/test_chart_drop_lines03.rb +1 -1
- data/test/regression/test_chart_drop_lines04.rb +1 -1
- data/test/regression/test_chart_errorbars01.rb +1 -1
- data/test/regression/test_chart_errorbars02.rb +1 -1
- data/test/regression/test_chart_errorbars03.rb +1 -1
- data/test/regression/test_chart_errorbars04.rb +1 -1
- data/test/regression/test_chart_errorbars05.rb +1 -1
- data/test/regression/test_chart_errorbars06.rb +1 -1
- data/test/regression/test_chart_errorbars07.rb +1 -1
- data/test/regression/test_chart_errorbars08.rb +1 -1
- data/test/regression/test_chart_errorbars09.rb +1 -1
- data/test/regression/test_chart_errorbars10.rb +1 -1
- data/test/regression/test_chart_font01.rb +1 -1
- data/test/regression/test_chart_font02.rb +1 -1
- data/test/regression/test_chart_font03.rb +1 -1
- data/test/regression/test_chart_font04.rb +1 -1
- data/test/regression/test_chart_font05.rb +1 -1
- data/test/regression/test_chart_font06.rb +1 -1
- data/test/regression/test_chart_font07.rb +1 -1
- data/test/regression/test_chart_font08.rb +1 -1
- data/test/regression/test_chart_font09.rb +2 -2
- data/test/regression/test_chart_format01.rb +1 -1
- data/test/regression/test_chart_format02.rb +1 -1
- data/test/regression/test_chart_format03.rb +1 -1
- data/test/regression/test_chart_format04.rb +1 -1
- data/test/regression/test_chart_format05.rb +1 -1
- data/test/regression/test_chart_format06.rb +1 -1
- data/test/regression/test_chart_format07.rb +1 -1
- data/test/regression/test_chart_format08.rb +1 -1
- data/test/regression/test_chart_format09.rb +1 -1
- data/test/regression/test_chart_format10.rb +1 -1
- data/test/regression/test_chart_format11.rb +1 -1
- data/test/regression/test_chart_format12.rb +1 -1
- data/test/regression/test_chart_format13.rb +1 -1
- data/test/regression/test_chart_format14.rb +1 -1
- data/test/regression/test_chart_format15.rb +1 -1
- data/test/regression/test_chart_format16.rb +1 -1
- data/test/regression/test_chart_format17.rb +1 -1
- data/test/regression/test_chart_format18.rb +1 -1
- data/test/regression/test_chart_format19.rb +1 -1
- data/test/regression/test_chart_format20.rb +1 -1
- data/test/regression/test_chart_format21.rb +47 -0
- data/test/regression/test_chart_format22.rb +47 -0
- data/test/regression/test_chart_format23.rb +47 -0
- data/test/regression/test_chart_format24.rb +52 -0
- data/test/regression/test_chart_format25.rb +46 -0
- data/test/regression/test_chart_format26.rb +48 -0
- data/test/regression/test_chart_format27.rb +58 -0
- data/test/regression/test_chart_format28.rb +52 -0
- data/test/regression/test_chart_format29.rb +59 -0
- data/test/regression/test_chart_format30.rb +53 -0
- data/test/regression/test_chart_format31.rb +60 -0
- data/test/regression/test_chart_gap01.rb +1 -1
- data/test/regression/test_chart_gap02.rb +1 -1
- data/test/regression/test_chart_gap03.rb +1 -1
- data/test/regression/test_chart_gap04.rb +1 -1
- data/test/regression/test_chart_gap05.rb +1 -1
- data/test/regression/test_chart_gradient01.rb +1 -1
- data/test/regression/test_chart_gradient02.rb +1 -1
- data/test/regression/test_chart_gradient03.rb +1 -1
- data/test/regression/test_chart_gradient04.rb +1 -1
- data/test/regression/test_chart_gradient05.rb +1 -1
- data/test/regression/test_chart_gradient06.rb +1 -1
- data/test/regression/test_chart_gradient07.rb +1 -1
- data/test/regression/test_chart_gradient08.rb +1 -1
- data/test/regression/test_chart_gradient09.rb +1 -1
- data/test/regression/test_chart_gradient10.rb +1 -1
- data/test/regression/test_chart_gradient11.rb +1 -1
- data/test/regression/test_chart_gradient12.rb +1 -1
- data/test/regression/test_chart_gradient13.rb +1 -1
- data/test/regression/test_chart_gridlines01.rb +1 -1
- data/test/regression/test_chart_gridlines02.rb +1 -1
- data/test/regression/test_chart_gridlines03.rb +1 -1
- data/test/regression/test_chart_gridlines04.rb +5 -4
- data/test/regression/test_chart_gridlines05.rb +1 -1
- data/test/regression/test_chart_gridlines06.rb +1 -1
- data/test/regression/test_chart_gridlines07.rb +1 -1
- data/test/regression/test_chart_gridlines08.rb +9 -12
- data/test/regression/test_chart_gridlines09.rb +1 -1
- data/test/regression/test_chart_layout01.rb +1 -1
- data/test/regression/test_chart_layout02.rb +1 -1
- data/test/regression/test_chart_layout03.rb +1 -1
- data/test/regression/test_chart_layout04.rb +1 -1
- data/test/regression/test_chart_layout05.rb +1 -1
- data/test/regression/test_chart_layout06.rb +1 -1
- data/test/regression/test_chart_layout07.rb +1 -1
- data/test/regression/test_chart_layout08.rb +1 -1
- data/test/regression/test_chart_legend01.rb +1 -1
- data/test/regression/test_chart_legend02.rb +1 -1
- data/test/regression/test_chart_legend03.rb +41 -0
- data/test/regression/test_chart_legend04.rb +41 -0
- data/test/regression/test_chart_legend05.rb +41 -0
- data/test/regression/test_chart_legend06.rb +41 -0
- data/test/regression/test_chart_legend07.rb +38 -0
- data/test/regression/test_chart_line01.rb +1 -1
- data/test/regression/test_chart_line02.rb +1 -1
- data/test/regression/test_chart_line03.rb +1 -1
- data/test/regression/test_chart_line04.rb +1 -1
- data/test/regression/test_chart_line05.rb +43 -0
- data/test/regression/test_chart_line06.rb +43 -0
- data/test/regression/test_chart_name01.rb +1 -1
- data/test/regression/test_chart_name02.rb +1 -1
- data/test/regression/test_chart_name03.rb +1 -1
- data/test/regression/test_chart_order01.rb +1 -1
- data/test/regression/test_chart_order02.rb +1 -1
- data/test/regression/test_chart_order03.rb +1 -1
- data/test/regression/test_chart_pattern01.rb +49 -0
- data/test/regression/test_chart_pattern02.rb +106 -0
- data/test/regression/test_chart_pattern03.rb +105 -0
- data/test/regression/test_chart_pattern04.rb +105 -0
- data/test/regression/test_chart_pattern05.rb +105 -0
- data/test/regression/test_chart_pattern06.rb +105 -0
- data/test/regression/test_chart_pattern07.rb +105 -0
- data/test/regression/test_chart_pattern08.rb +105 -0
- data/test/regression/test_chart_pattern09.rb +57 -0
- data/test/regression/test_chart_pattern10.rb +57 -0
- data/test/regression/test_chart_pie01.rb +1 -1
- data/test/regression/test_chart_pie02.rb +1 -1
- data/test/regression/test_chart_pie03.rb +1 -1
- data/test/regression/test_chart_pie04.rb +1 -1
- data/test/regression/test_chart_pie05.rb +1 -1
- data/test/regression/test_chart_points01.rb +1 -1
- data/test/regression/test_chart_points02.rb +1 -1
- data/test/regression/test_chart_points03.rb +1 -1
- data/test/regression/test_chart_points04.rb +1 -1
- data/test/regression/test_chart_points05.rb +1 -1
- data/test/regression/test_chart_points06.rb +1 -1
- data/test/regression/test_chart_radar01.rb +1 -1
- data/test/regression/test_chart_radar02.rb +1 -1
- data/test/regression/test_chart_radar03.rb +1 -1
- data/test/regression/test_chart_scatter01.rb +1 -1
- data/test/regression/test_chart_scatter02.rb +1 -1
- data/test/regression/test_chart_scatter03.rb +1 -1
- data/test/regression/test_chart_scatter04.rb +1 -1
- data/test/regression/test_chart_scatter05.rb +1 -1
- data/test/regression/test_chart_scatter06.rb +1 -1
- data/test/regression/test_chart_scatter07.rb +1 -1
- data/test/regression/test_chart_scatter08.rb +1 -1
- data/test/regression/test_chart_scatter09.rb +1 -1
- data/test/regression/test_chart_scatter10.rb +1 -1
- data/test/regression/test_chart_scatter11.rb +1 -1
- data/test/regression/test_chart_scatter12.rb +1 -1
- data/test/regression/test_chart_scatter13.rb +1 -1
- data/test/regression/test_chart_scatter14.rb +1 -1
- data/test/regression/test_chart_scatter15.rb +1 -1
- data/test/regression/test_chart_size01.rb +1 -1
- data/test/regression/test_chart_size02.rb +1 -1
- data/test/regression/test_chart_size03.rb +5 -2
- data/test/regression/test_chart_size04.rb +1 -1
- data/test/regression/test_chart_size05.rb +1 -1
- data/test/regression/test_chart_sparse01.rb +1 -1
- data/test/regression/test_chart_stock01.rb +1 -1
- data/test/regression/test_chart_stock02.rb +1 -1
- data/test/regression/test_chart_str01.rb +1 -1
- data/test/regression/test_chart_str02.rb +1 -1
- data/test/regression/test_chart_table01.rb +1 -1
- data/test/regression/test_chart_table02.rb +1 -1
- data/test/regression/test_chart_table03.rb +56 -0
- data/test/regression/test_chart_title01.rb +1 -1
- data/test/regression/test_chart_title02.rb +1 -1
- data/test/regression/test_chartsheet01.rb +1 -1
- data/test/regression/test_chartsheet02.rb +1 -1
- data/test/regression/test_chartsheet03.rb +1 -1
- data/test/regression/test_chartsheet04.rb +1 -1
- data/test/regression/test_chartsheet05.rb +1 -1
- data/test/regression/test_chartsheet06.rb +1 -1
- data/test/regression/test_chartsheet07.rb +1 -1
- data/test/regression/test_chartsheet08.rb +1 -1
- data/test/regression/test_chartsheet09.rb +1 -1
- data/test/regression/test_comment01.rb +1 -1
- data/test/regression/test_comment02.rb +1 -1
- data/test/regression/test_comment03.rb +1 -1
- data/test/regression/test_comment04.rb +1 -1
- data/test/regression/test_comment06.rb +1 -1
- data/test/regression/test_comment07.rb +1 -1
- data/test/regression/test_comment08.rb +1 -1
- data/test/regression/test_comment09.rb +1 -1
- data/test/regression/test_comment10.rb +1 -1
- data/test/regression/test_comment11.rb +1 -1
- data/test/regression/test_comment12.rb +1 -1
- data/test/regression/test_comment13.rb +36 -0
- data/test/regression/test_comment14.rb +29 -0
- data/test/regression/test_comment15.rb +28 -0
- data/test/regression/test_comment16.rb +34 -0
- data/test/regression/test_cond_format01.rb +1 -1
- data/test/regression/test_cond_format02.rb +1 -1
- data/test/regression/test_cond_format03.rb +1 -1
- data/test/regression/test_cond_format04.rb +1 -1
- data/test/regression/test_cond_format05.rb +1 -1
- data/test/regression/test_cond_format06.rb +1 -1
- data/test/regression/test_cond_format07.rb +1 -1
- data/test/regression/test_cond_format08.rb +1 -1
- data/test/regression/test_cond_format10.rb +1 -1
- data/test/regression/test_cond_format11.rb +1 -1
- data/test/regression/test_cond_format12.rb +1 -1
- data/test/regression/test_cond_format13.rb +1 -1
- data/test/regression/test_cond_format14.rb +42 -0
- data/test/regression/test_cond_format15.rb +53 -0
- data/test/regression/test_cond_format16.rb +53 -0
- data/test/regression/test_cond_format17.rb +37 -0
- data/test/regression/test_cond_format18.rb +136 -0
- data/test/regression/test_cond_format19.rb +64 -0
- data/test/regression/test_cond_format20.rb +43 -0
- data/test/regression/test_custom_colors01.rb +1 -1
- data/test/regression/test_data_validation01.rb +1 -1
- data/test/regression/test_data_validation02.rb +1 -1
- data/test/regression/test_data_validation03.rb +1 -1
- data/test/regression/test_data_validation04.rb +2 -2
- data/test/regression/test_data_validation05.rb +2 -2
- data/test/regression/test_data_validation08.rb +24 -0
- data/test/regression/test_date_1904_01.rb +2 -2
- data/test/regression/test_date_1904_02.rb +1 -1
- data/test/regression/test_date_examples01.rb +1 -1
- data/test/regression/test_default_format01.rb +1 -1
- data/test/regression/test_default_row01.rb +1 -1
- data/test/regression/test_default_row02.rb +1 -1
- data/test/regression/test_default_row03.rb +1 -1
- data/test/regression/test_default_row04.rb +1 -1
- data/test/regression/test_default_row05.rb +32 -0
- data/test/regression/test_defined_name01.rb +1 -1
- data/test/regression/test_defined_name02.rb +1 -1
- data/test/regression/test_defined_name03.rb +1 -1
- data/test/regression/test_defined_name04.rb +15 -15
- data/test/regression/test_dynamic_array01.rb +25 -0
- data/test/regression/test_escapes01.rb +1 -1
- data/test/regression/test_escapes02.rb +1 -1
- data/test/regression/test_escapes03.rb +1 -1
- data/test/regression/test_escapes04.rb +4 -1
- data/test/regression/test_escapes05.rb +4 -1
- data/test/regression/test_escapes06.rb +1 -1
- data/test/regression/test_escapes07.rb +4 -1
- data/test/regression/test_escapes08.rb +4 -1
- data/test/regression/test_excel2003_style01.rb +1 -1
- data/test/regression/test_excel2003_style02.rb +1 -1
- data/test/regression/test_excel2003_style03.rb +1 -1
- data/test/regression/test_excel2003_style04.rb +1 -1
- data/test/regression/test_excel2003_style05.rb +1 -1
- data/test/regression/test_excel2003_style06.rb +1 -1
- data/test/regression/test_excel2003_style07.rb +1 -1
- data/test/regression/test_excel2003_style08.rb +1 -1
- data/test/regression/test_firstsheet01.rb +1 -1
- data/test/regression/test_fit_to_pages01.rb +1 -1
- data/test/regression/test_fit_to_pages02.rb +1 -1
- data/test/regression/test_fit_to_pages03.rb +1 -1
- data/test/regression/test_fit_to_pages04.rb +1 -1
- data/test/regression/test_fit_to_pages05.rb +1 -1
- data/test/regression/test_format01.rb +1 -1
- data/test/regression/test_format02.rb +1 -1
- data/test/regression/test_format03.rb +1 -1
- data/test/regression/test_format04.rb +1 -1
- data/test/regression/test_format05.rb +1 -1
- data/test/regression/test_format11.rb +1 -1
- data/test/regression/test_format12.rb +1 -1
- data/test/regression/test_format13.rb +31 -0
- data/test/regression/test_format14.rb +26 -0
- data/test/regression/test_format15.rb +26 -0
- data/test/regression/test_format16.rb +24 -0
- data/test/regression/test_format17.rb +24 -0
- data/test/regression/test_formula_results01.rb +1 -1
- data/test/regression/test_gridlines01.rb +1 -1
- data/test/regression/test_header01.rb +1 -1
- data/test/regression/test_header02.rb +1 -1
- data/test/regression/test_header03.rb +1 -1
- data/test/regression/test_header04.rb +30 -0
- data/test/regression/test_header_image01.rb +1 -1
- data/test/regression/test_header_image02.rb +1 -1
- data/test/regression/test_header_image03.rb +1 -1
- data/test/regression/test_header_image04.rb +1 -1
- data/test/regression/test_header_image05.rb +1 -1
- data/test/regression/test_header_image06.rb +1 -1
- data/test/regression/test_header_image07.rb +1 -1
- data/test/regression/test_header_image08.rb +1 -1
- data/test/regression/test_header_image09.rb +1 -1
- data/test/regression/test_header_image10.rb +1 -1
- data/test/regression/test_header_image11.rb +1 -1
- data/test/regression/test_header_image12.rb +1 -1
- data/test/regression/test_header_image13.rb +1 -1
- data/test/regression/test_header_image14.rb +1 -1
- data/test/regression/test_header_image15.rb +36 -0
- data/test/regression/test_header_image16.rb +42 -0
- data/test/regression/test_header_image17.rb +46 -0
- data/test/regression/test_header_image18.rb +48 -0
- data/test/regression/test_header_image19.rb +36 -0
- data/test/regression/test_hide01.rb +1 -1
- data/test/regression/test_hyperlink01.rb +4 -1
- data/test/regression/test_hyperlink02.rb +4 -1
- data/test/regression/test_hyperlink03.rb +5 -1
- data/test/regression/test_hyperlink04.rb +4 -1
- data/test/regression/test_hyperlink05.rb +4 -1
- data/test/regression/test_hyperlink06.rb +4 -1
- data/test/regression/test_hyperlink07.rb +4 -1
- data/test/regression/test_hyperlink08.rb +4 -1
- data/test/regression/test_hyperlink09.rb +4 -1
- data/test/regression/test_hyperlink10.rb +4 -1
- data/test/regression/test_hyperlink11.rb +4 -1
- data/test/regression/test_hyperlink12.rb +4 -1
- data/test/regression/test_hyperlink13.rb +4 -1
- data/test/regression/test_hyperlink14.rb +4 -1
- data/test/regression/test_hyperlink15.rb +4 -1
- data/test/regression/test_hyperlink16.rb +4 -1
- data/test/regression/test_hyperlink17.rb +4 -1
- data/test/regression/test_hyperlink18.rb +4 -1
- data/test/regression/test_hyperlink20.rb +4 -1
- data/test/regression/test_hyperlink21.rb +4 -1
- data/test/regression/test_hyperlink22.rb +27 -0
- data/test/regression/test_hyperlink23.rb +27 -0
- data/test/regression/test_hyperlink24.rb +27 -0
- data/test/regression/test_hyperlink25.rb +30 -0
- data/test/regression/test_hyperlink26.rb +30 -0
- data/test/regression/test_hyperlink27.rb +27 -0
- data/test/regression/test_hyperlink28.rb +50 -0
- data/test/regression/test_hyperlink29.rb +27 -0
- data/test/regression/test_hyperlink30.rb +36 -0
- data/test/regression/test_hyperlink32.rb +27 -0
- data/test/regression/test_hyperlink33.rb +28 -0
- data/test/regression/test_hyperlink34.rb +33 -0
- data/test/regression/test_hyperlink35.rb +39 -0
- data/test/regression/test_hyperlink36.rb +34 -0
- data/test/regression/test_hyperlink37.rb +33 -0
- data/test/regression/test_hyperlink38.rb +27 -0
- data/test/regression/test_hyperlink39.rb +27 -0
- data/test/regression/test_hyperlink40.rb +27 -0
- data/test/regression/test_hyperlink41.rb +27 -0
- data/test/regression/test_hyperlink42.rb +27 -0
- data/test/regression/test_hyperlink43.rb +27 -0
- data/test/regression/test_hyperlink44.rb +27 -0
- data/test/regression/test_hyperlink45.rb +27 -0
- data/test/regression/test_hyperlink47.rb +27 -0
- data/test/regression/test_hyperlink48.rb +31 -0
- data/test/regression/test_hyperlink49.rb +29 -0
- data/test/regression/test_hyperlink50.rb +27 -0
- data/test/regression/test_hyperlink51.rb +27 -0
- data/test/regression/test_ignore_error01.rb +23 -0
- data/test/regression/test_ignore_error02.rb +24 -0
- data/test/regression/test_ignore_error03.rb +26 -0
- data/test/regression/test_ignore_error04.rb +26 -0
- data/test/regression/test_ignore_error05.rb +32 -0
- data/test/regression/test_ignore_error06.rb +32 -0
- data/test/regression/test_image01.rb +1 -1
- data/test/regression/test_image02.rb +1 -1
- data/test/regression/test_image03.rb +1 -1
- data/test/regression/test_image04.rb +1 -1
- data/test/regression/test_image05.rb +1 -1
- data/test/regression/test_image06.rb +6 -6
- data/test/regression/test_image07.rb +1 -1
- data/test/regression/test_image08.rb +6 -5
- data/test/regression/test_image09.rb +1 -1
- data/test/regression/test_image10.rb +1 -1
- data/test/regression/test_image11.rb +1 -1
- data/test/regression/test_image12.rb +1 -1
- data/test/regression/test_image13.rb +1 -1
- data/test/regression/test_image14.rb +1 -1
- data/test/regression/test_image15.rb +5 -3
- data/test/regression/test_image16.rb +1 -1
- data/test/regression/test_image17.rb +1 -1
- data/test/regression/test_image18.rb +1 -1
- data/test/regression/test_image19.rb +1 -1
- data/test/regression/test_image22.rb +1 -1
- data/test/regression/test_image23.rb +1 -1
- data/test/regression/test_image24.rb +1 -1
- data/test/regression/test_image25.rb +1 -1
- data/test/regression/test_image26.rb +1 -1
- data/test/regression/test_image27.rb +1 -1
- data/test/regression/test_image28.rb +27 -0
- data/test/regression/test_image29.rb +27 -0
- data/test/regression/test_image30.rb +27 -0
- data/test/regression/test_image31.rb +30 -0
- data/test/regression/test_image32.rb +28 -0
- data/test/regression/test_image33.rb +32 -0
- data/test/regression/test_image35.rb +26 -0
- data/test/regression/test_image36.rb +26 -0
- data/test/regression/test_image44.rb +28 -0
- data/test/regression/test_image45.rb +29 -0
- data/test/regression/test_image46.rb +29 -0
- data/test/regression/test_image47.rb +28 -0
- data/test/regression/test_image48.rb +32 -0
- data/test/regression/test_image49.rb +38 -0
- data/test/regression/test_image50.rb +24 -0
- data/test/regression/test_image51.rb +30 -0
- data/test/regression/test_image52.rb +26 -0
- data/test/regression/test_image53.rb +26 -0
- data/test/regression/test_image54.rb +26 -0
- data/test/regression/test_image55.rb +27 -0
- data/test/regression/test_image56.rb +23 -0
- data/test/regression/test_image57.rb +23 -0
- data/test/regression/test_landscape01.rb +1 -1
- data/test/regression/test_macro01.rb +1 -1
- data/test/regression/test_merge_cells01.rb +1 -1
- data/test/regression/test_merge_range01.rb +1 -1
- data/test/regression/test_merge_range02.rb +1 -1
- data/test/regression/test_merge_range03.rb +1 -1
- data/test/regression/test_merge_range04.rb +1 -1
- data/test/regression/test_merge_range05.rb +1 -1
- data/test/regression/test_object_position01.rb +26 -0
- data/test/regression/test_object_position02.rb +26 -0
- data/test/regression/test_object_position03.rb +26 -0
- data/test/regression/test_object_position04.rb +44 -0
- data/test/regression/test_object_position06.rb +28 -0
- data/test/regression/test_object_position07.rb +28 -0
- data/test/regression/test_object_position08.rb +47 -0
- data/test/regression/test_object_position09.rb +50 -0
- data/test/regression/test_object_position10.rb +28 -0
- data/test/regression/test_object_position12.rb +25 -0
- data/test/regression/test_object_position13.rb +25 -0
- data/test/regression/test_object_position14.rb +25 -0
- data/test/regression/test_object_position15.rb +29 -0
- data/test/regression/test_object_position16.rb +29 -0
- data/test/regression/test_object_position17.rb +29 -0
- data/test/regression/test_object_position18.rb +29 -0
- data/test/regression/test_object_position19.rb +29 -0
- data/test/regression/test_object_position20.rb +29 -0
- data/test/regression/test_outline01.rb +1 -1
- data/test/regression/test_outline02.rb +1 -1
- data/test/regression/test_outline03.rb +1 -1
- data/test/regression/test_outline04.rb +1 -1
- data/test/regression/test_outline05.rb +1 -1
- data/test/regression/test_outline06.rb +1 -1
- data/test/regression/test_page_breaks01.rb +1 -1
- data/test/regression/test_page_breaks02.rb +1 -1
- data/test/regression/test_page_breaks03.rb +1 -1
- data/test/regression/test_page_breaks04.rb +1 -1
- data/test/regression/test_page_breaks05.rb +1 -1
- data/test/regression/test_page_breaks06.rb +1 -1
- data/test/regression/test_page_view01.rb +1 -1
- data/test/regression/test_panes01.rb +1 -1
- data/test/regression/test_print_across01.rb +1 -1
- data/test/regression/test_print_area01.rb +1 -1
- data/test/regression/test_print_area02.rb +1 -1
- data/test/regression/test_print_area03.rb +1 -1
- data/test/regression/test_print_area04.rb +1 -1
- data/test/regression/test_print_area05.rb +1 -1
- data/test/regression/test_print_area06.rb +1 -1
- data/test/regression/test_print_area07.rb +1 -1
- data/test/regression/test_print_options01.rb +1 -1
- data/test/regression/test_print_options02.rb +1 -1
- data/test/regression/test_print_options03.rb +1 -1
- data/test/regression/test_print_options04.rb +1 -1
- data/test/regression/test_print_options05.rb +1 -1
- data/test/regression/test_print_options06.rb +1 -1
- data/test/regression/test_print_options07.rb +1 -1
- data/test/regression/test_print_scale01.rb +1 -1
- data/test/regression/test_print_scale02.rb +1 -1
- data/test/regression/test_properties01.rb +2 -5
- data/test/regression/test_properties02.rb +25 -0
- data/test/regression/test_properties03.rb +26 -0
- data/test/regression/test_properties04.rb +61 -0
- data/test/regression/test_properties05.rb +30 -0
- data/test/regression/test_protect01.rb +1 -1
- data/test/regression/test_protect02.rb +1 -1
- data/test/regression/test_protect03.rb +1 -1
- data/test/regression/test_protect04.rb +32 -0
- data/test/regression/test_protect05.rb +35 -0
- data/test/regression/test_protect06.rb +35 -0
- data/test/regression/test_protect07.rb +23 -0
- data/test/regression/test_quote_name01.rb +1 -1
- data/test/regression/test_quote_name03.rb +1 -1
- data/test/regression/test_quote_name04.rb +1 -1
- data/test/regression/test_repeat01.rb +1 -1
- data/test/regression/test_repeat02.rb +1 -1
- data/test/regression/test_repeat03.rb +1 -1
- data/test/regression/test_repeat04.rb +1 -1
- data/test/regression/test_repeat05.rb +1 -1
- data/test/regression/test_rich_string01.rb +1 -1
- data/test/regression/test_rich_string02.rb +1 -1
- data/test/regression/test_rich_string03.rb +1 -1
- data/test/regression/test_rich_string04.rb +1 -1
- data/test/regression/test_rich_string05.rb +1 -1
- data/test/regression/test_rich_string06.rb +1 -1
- data/test/regression/test_rich_string07.rb +1 -1
- data/test/regression/test_rich_string08.rb +1 -1
- data/test/regression/test_rich_string09.rb +1 -1
- data/test/regression/test_rich_string10.rb +1 -1
- data/test/regression/test_rich_string11.rb +1 -1
- data/test/regression/test_rich_string12.rb +1 -1
- data/test/regression/test_row_col_format01.rb +1 -1
- data/test/regression/test_row_col_format02.rb +1 -1
- data/test/regression/test_row_col_format03.rb +1 -1
- data/test/regression/test_row_col_format04.rb +1 -1
- data/test/regression/test_row_col_format05.rb +1 -1
- data/test/regression/test_row_col_format06.rb +1 -1
- data/test/regression/test_row_col_format07.rb +1 -1
- data/test/regression/test_row_col_format08.rb +1 -1
- data/test/regression/test_row_col_format09.rb +1 -1
- data/test/regression/test_row_col_format10.rb +1 -1
- data/test/regression/test_row_col_format11.rb +1 -1
- data/test/regression/test_row_col_format12.rb +1 -1
- data/test/regression/test_row_col_format13.rb +1 -1
- data/test/regression/test_row_col_format14.rb +1 -1
- data/test/regression/test_selection01.rb +1 -1
- data/test/regression/test_selection02.rb +1 -1
- data/test/regression/test_set_column01.rb +1 -1
- data/test/regression/test_set_column02.rb +1 -1
- data/test/regression/test_set_column03.rb +1 -1
- data/test/regression/test_set_column04.rb +1 -1
- data/test/regression/test_set_column05.rb +1 -1
- data/test/regression/test_set_column06.rb +1 -1
- data/test/regression/test_set_column07.rb +1 -1
- data/test/regression/test_set_column08.rb +1 -1
- data/test/regression/test_set_column09.rb +1 -1
- data/test/regression/test_set_column10.rb +55 -0
- data/test/regression/test_set_column11.rb +48 -0
- data/test/regression/test_set_print_scale01.rb +1 -1
- data/test/regression/test_set_row01.rb +35 -0
- data/test/regression/test_set_row02.rb +35 -0
- data/test/regression/test_set_row03.rb +35 -0
- data/test/regression/test_set_row04.rb +35 -0
- data/test/regression/test_set_start_page01.rb +1 -1
- data/test/regression/test_set_start_page02.rb +1 -1
- data/test/regression/test_set_start_page03.rb +1 -1
- data/test/regression/test_shape01.rb +1 -1
- data/test/regression/test_shape02.rb +1 -1
- data/test/regression/test_shape03.rb +1 -1
- data/test/regression/test_shape04.rb +1 -1
- data/test/regression/test_shape_connect01.rb +5 -3
- data/test/regression/test_shape_connect02.rb +1 -1
- data/test/regression/test_shape_connect03.rb +1 -1
- data/test/regression/test_shape_connect04.rb +1 -1
- data/test/regression/test_shape_scale01.rb +1 -1
- data/test/regression/test_shape_stencil01.rb +1 -1
- data/test/regression/test_shared_strings01.rb +1 -1
- data/test/regression/test_shared_strings02.rb +1 -1
- data/test/regression/test_simple01.rb +1 -1
- data/test/regression/test_simple02.rb +1 -1
- data/test/regression/test_simple03.rb +1 -1
- data/test/regression/test_simple04.rb +1 -1
- data/test/regression/test_simple05.rb +1 -1
- data/test/regression/test_tab_color01.rb +1 -1
- data/test/regression/test_table01.rb +1 -1
- data/test/regression/test_table02.rb +1 -1
- data/test/regression/test_table03.rb +4 -1
- data/test/regression/test_table04.rb +4 -1
- data/test/regression/test_table05.rb +4 -1
- data/test/regression/test_table06.rb +4 -1
- data/test/regression/test_table07.rb +1 -1
- data/test/regression/test_table08.rb +1 -1
- data/test/regression/test_table09.rb +1 -1
- data/test/regression/test_table10.rb +1 -1
- data/test/regression/test_table11.rb +1 -1
- data/test/regression/test_table12.rb +1 -1
- data/test/regression/test_table13.rb +1 -1
- data/test/regression/test_table14.rb +1 -1
- data/test/regression/test_table15.rb +1 -1
- data/test/regression/test_table16.rb +1 -1
- data/test/regression/test_table17.rb +1 -1
- data/test/regression/test_table20.rb +34 -0
- data/test/regression/test_table21.rb +36 -0
- data/test/regression/test_table22.rb +32 -0
- data/test/regression/test_table23.rb +56 -0
- data/test/regression/test_table24.rb +27 -0
- data/test/regression/test_table25.rb +27 -0
- data/test/regression/test_table26.rb +38 -0
- data/test/regression/test_tutorial01.rb +1 -1
- data/test/regression/test_tutorial02.rb +1 -1
- data/test/regression/test_tutorial03.rb +1 -1
- data/test/regression/test_types02.rb +25 -0
- data/test/regression/test_types08.rb +31 -0
- data/test/regression/test_update_range_format_with_params.rb +42 -0
- data/test/regression/test_urls_as_strings.rb +1 -1
- data/test/regression/test_utf8_01.rb +1 -1
- data/test/regression/test_utf8_03.rb +1 -1
- data/test/regression/test_utf8_04.rb +1 -1
- data/test/regression/test_utf8_05.rb +1 -1
- data/test/regression/test_utf8_06.rb +1 -1
- data/test/regression/test_utf8_07.rb +1 -1
- data/test/regression/test_utf8_08.rb +1 -1
- data/test/regression/test_utf8_09.rb +1 -1
- data/test/regression/test_utf8_10.rb +1 -1
- data/test/regression/test_utf8_11.rb +23 -0
- data/test/regression/test_vml01.rb +1 -1
- data/test/regression/test_vml02.rb +1 -1
- data/test/regression/test_vml03.rb +1 -1
- data/test/regression/xlsx_files/array_formula03.xlsx +0 -0
- data/test/regression/xlsx_files/array_formula04.xlsx +0 -0
- data/test/regression/xlsx_files/autofilter08.xlsx +0 -0
- data/test/regression/xlsx_files/autofilter09.xlsx +0 -0
- data/test/regression/xlsx_files/autofilter10.xlsx +0 -0
- data/test/regression/xlsx_files/background01.xlsx +0 -0
- data/test/regression/xlsx_files/background02.xlsx +0 -0
- data/test/regression/xlsx_files/background03.xlsx +0 -0
- data/test/regression/xlsx_files/background04.xlsx +0 -0
- data/test/regression/xlsx_files/background05.xlsx +0 -0
- data/test/regression/xlsx_files/background06.xlsx +0 -0
- data/test/regression/xlsx_files/background07.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis26.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis27.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis28.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis29.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis33.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis40.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis41.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis42.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis43.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis44.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis45.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis46.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis47.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis48.xlsx +0 -0
- data/test/regression/xlsx_files/chart_chartarea05.xlsx +0 -0
- data/test/regression/xlsx_files/chart_chartarea06.xlsx +0 -0
- data/test/regression/xlsx_files/chart_combined09.xlsx +0 -0
- data/test/regression/xlsx_files/chart_combined10.xlsx +0 -0
- data/test/regression/xlsx_files/chart_combined11.xlsx +0 -0
- data/test/regression/xlsx_files/chart_crossing05.xlsx +0 -0
- data/test/regression/xlsx_files/chart_crossing06.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels25.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels26.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels27.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels28.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels29.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels30.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels31.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels32.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels33.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels34.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels35.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels36.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels37.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels38.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels39.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels40.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels41.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels42.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels43.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels44.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels45.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels46.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels47.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels48.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels49.xlsx +0 -0
- data/test/regression/xlsx_files/chart_data_labels50.xlsx +0 -0
- data/test/regression/xlsx_files/chart_doughnut07.xlsx +0 -0
- data/test/regression/xlsx_files/chart_font09.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format21.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format22.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format23.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format24.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format25.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format26.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format27.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format28.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format29.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format30.xlsx +0 -0
- data/test/regression/xlsx_files/chart_format31.xlsx +0 -0
- data/test/regression/xlsx_files/chart_legend03.xlsx +0 -0
- data/test/regression/xlsx_files/chart_legend04.xlsx +0 -0
- data/test/regression/xlsx_files/chart_legend05.xlsx +0 -0
- data/test/regression/xlsx_files/chart_legend06.xlsx +0 -0
- data/test/regression/xlsx_files/chart_legend07.xlsx +0 -0
- data/test/regression/xlsx_files/chart_line05.xlsx +0 -0
- data/test/regression/xlsx_files/chart_line06.xlsx +0 -0
- data/test/regression/xlsx_files/chart_pattern01.xlsx +0 -0
- data/test/regression/xlsx_files/chart_pattern02.xlsx +0 -0
- data/test/regression/xlsx_files/chart_pattern03.xlsx +0 -0
- data/test/regression/xlsx_files/chart_pattern04.xlsx +0 -0
- data/test/regression/xlsx_files/chart_pattern05.xlsx +0 -0
- data/test/regression/xlsx_files/chart_pattern06.xlsx +0 -0
- data/test/regression/xlsx_files/chart_pattern07.xlsx +0 -0
- data/test/regression/xlsx_files/chart_pattern08.xlsx +0 -0
- data/test/regression/xlsx_files/chart_pattern09.xlsx +0 -0
- data/test/regression/xlsx_files/chart_pattern10.xlsx +0 -0
- data/test/regression/xlsx_files/chart_table03.xlsx +0 -0
- data/test/regression/xlsx_files/comment13.xlsx +0 -0
- data/test/regression/xlsx_files/comment14.xlsx +0 -0
- data/test/regression/xlsx_files/comment15.xlsx +0 -0
- data/test/regression/xlsx_files/comment16.xlsx +0 -0
- data/test/regression/xlsx_files/cond_format14.xlsx +0 -0
- data/test/regression/xlsx_files/cond_format15.xlsx +0 -0
- data/test/regression/xlsx_files/cond_format16.xlsx +0 -0
- data/test/regression/xlsx_files/cond_format17.xlsx +0 -0
- data/test/regression/xlsx_files/cond_format18.xlsx +0 -0
- data/test/regression/xlsx_files/cond_format19.xlsx +0 -0
- data/test/regression/xlsx_files/cond_format20.xlsx +0 -0
- data/test/regression/xlsx_files/data_validation08.xlsx +0 -0
- data/test/regression/xlsx_files/date_1904_01.xlsx +0 -0
- data/test/regression/xlsx_files/default_row05.xlsx +0 -0
- data/test/regression/xlsx_files/dynamic_array01.xlsx +0 -0
- data/test/regression/xlsx_files/format13.xlsx +0 -0
- data/test/regression/xlsx_files/format14.xlsx +0 -0
- data/test/regression/xlsx_files/format15.xlsx +0 -0
- data/test/regression/xlsx_files/format16.xlsx +0 -0
- data/test/regression/xlsx_files/format17.xlsx +0 -0
- data/test/regression/xlsx_files/header04.xlsx +0 -0
- data/test/regression/xlsx_files/header_image15.xlsx +0 -0
- data/test/regression/xlsx_files/header_image16.xlsx +0 -0
- data/test/regression/xlsx_files/header_image17.xlsx +0 -0
- data/test/regression/xlsx_files/header_image18.xlsx +0 -0
- data/test/regression/xlsx_files/header_image19.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink22.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink23.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink24.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink25.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink26.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink27.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink28.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink29.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink30.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink31.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink32.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink33.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink34.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink35.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink36.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink37.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink38.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink39.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink40.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink41.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink42.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink43.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink44.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink45.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink46.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink47.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink48.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink49.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink50.xlsx +0 -0
- data/test/regression/xlsx_files/hyperlink51.xlsx +0 -0
- data/test/regression/xlsx_files/ignore_error01.xlsx +0 -0
- data/test/regression/xlsx_files/ignore_error02.xlsx +0 -0
- data/test/regression/xlsx_files/ignore_error03.xlsx +0 -0
- data/test/regression/xlsx_files/ignore_error04.xlsx +0 -0
- data/test/regression/xlsx_files/ignore_error05.xlsx +0 -0
- data/test/regression/xlsx_files/ignore_error06.xlsx +0 -0
- data/test/regression/xlsx_files/image06.xlsx +0 -0
- data/test/regression/xlsx_files/image28.xlsx +0 -0
- data/test/regression/xlsx_files/image29.xlsx +0 -0
- data/test/regression/xlsx_files/image30.xlsx +0 -0
- data/test/regression/xlsx_files/image31.xlsx +0 -0
- data/test/regression/xlsx_files/image32.xlsx +0 -0
- data/test/regression/xlsx_files/image33.xlsx +0 -0
- data/test/regression/xlsx_files/image35.xlsx +0 -0
- data/test/regression/xlsx_files/image36.xlsx +0 -0
- data/test/regression/xlsx_files/image44.xlsx +0 -0
- data/test/regression/xlsx_files/image45.xlsx +0 -0
- data/test/regression/xlsx_files/image46.xlsx +0 -0
- data/test/regression/xlsx_files/image47.xlsx +0 -0
- data/test/regression/xlsx_files/image48.xlsx +0 -0
- data/test/regression/xlsx_files/image49.xlsx +0 -0
- data/test/regression/xlsx_files/image50.xlsx +0 -0
- data/test/regression/xlsx_files/image51.xlsx +0 -0
- data/test/regression/xlsx_files/image52.xlsx +0 -0
- data/test/regression/xlsx_files/image53.xlsx +0 -0
- data/test/regression/xlsx_files/image54.xlsx +0 -0
- data/test/regression/xlsx_files/image55.xlsx +0 -0
- data/test/regression/xlsx_files/image56.xlsx +0 -0
- data/test/regression/xlsx_files/image57.xlsx +0 -0
- data/test/regression/xlsx_files/object_position01.xlsx +0 -0
- data/test/regression/xlsx_files/object_position02.xlsx +0 -0
- data/test/regression/xlsx_files/object_position03.xlsx +0 -0
- data/test/regression/xlsx_files/object_position04.xlsx +0 -0
- data/test/regression/xlsx_files/object_position06.xlsx +0 -0
- data/test/regression/xlsx_files/object_position07.xlsx +0 -0
- data/test/regression/xlsx_files/object_position08.xlsx +0 -0
- data/test/regression/xlsx_files/object_position09.xlsx +0 -0
- data/test/regression/xlsx_files/object_position10.xlsx +0 -0
- data/test/regression/xlsx_files/object_position12.xlsx +0 -0
- data/test/regression/xlsx_files/object_position13.xlsx +0 -0
- data/test/regression/xlsx_files/object_position14.xlsx +0 -0
- data/test/regression/xlsx_files/object_position15.xlsx +0 -0
- data/test/regression/xlsx_files/object_position16.xlsx +0 -0
- data/test/regression/xlsx_files/object_position17.xlsx +0 -0
- data/test/regression/xlsx_files/object_position18.xlsx +0 -0
- data/test/regression/xlsx_files/object_position19.xlsx +0 -0
- data/test/regression/xlsx_files/object_position20.xlsx +0 -0
- data/test/regression/xlsx_files/properties02.xlsx +0 -0
- data/test/regression/xlsx_files/properties03.xlsx +0 -0
- data/test/regression/xlsx_files/properties04.xlsx +0 -0
- data/test/regression/xlsx_files/properties05.xlsx +0 -0
- data/test/regression/xlsx_files/protect04.xlsx +0 -0
- data/test/regression/xlsx_files/protect05.xlsx +0 -0
- data/test/regression/xlsx_files/protect06.xlsx +0 -0
- data/test/regression/xlsx_files/protect07.xlsx +0 -0
- data/test/regression/xlsx_files/set_row01.xlsx +0 -0
- data/test/regression/xlsx_files/set_row03.xlsx +0 -0
- data/test/regression/xlsx_files/table18.xlsx +0 -0
- data/test/regression/xlsx_files/table19.xlsx +0 -0
- data/test/regression/xlsx_files/table21.xlsx +0 -0
- data/test/regression/xlsx_files/table22.xlsx +0 -0
- data/test/regression/xlsx_files/table23.xlsx +0 -0
- data/test/regression/xlsx_files/table24.xlsx +0 -0
- data/test/regression/xlsx_files/table25.xlsx +0 -0
- data/test/regression/xlsx_files/table26.xlsx +0 -0
- data/test/regression/xlsx_files/types02.xlsx +0 -0
- data/test/regression/xlsx_files/types08.xlsx +0 -0
- data/test/regression/xlsx_files/update_range_format_with_params.xlsx +0 -0
- data/test/regression/xlsx_files/utf8_11.xlsx +0 -0
- data/test/test_delete_files.rb +3 -3
- data/test/test_example_match.rb +1342 -781
- data/test/test_option_hash_for_workbook.rb +1 -1
- data/test/test_xml_writer_simple.rb +1 -1
- data/test/utility/test_range.rb +20 -0
- data/test/workbook/test_check_sheetname.rb +51 -0
- data/test/workbook/test_define_name.rb +1 -1
- data/test/workbook/test_get_chart_range.rb +3 -5
- data/test/workbook/test_sort_defined_names.rb +1 -1
- data/test/workbook/test_workbook_01.rb +1 -1
- data/test/workbook/test_workbook_02.rb +1 -1
- data/test/workbook/test_workbook_03.rb +1 -1
- data/test/workbook/test_worksheet_by_name.rb +35 -0
- data/test/workbook/test_write_calc_pr.rb +1 -1
- data/test/workbook/test_write_defined_name.rb +1 -1
- data/test/workbook/test_write_defined_names.rb +1 -1
- data/test/workbook/test_write_workbook_view.rb +117 -0
- data/test/worksheet/test_calculate_spans.rb +1 -1
- data/test/worksheet/test_cond_format_01.rb +1 -1
- data/test/worksheet/test_cond_format_02.rb +1 -1
- data/test/worksheet/test_cond_format_03.rb +1 -1
- data/test/worksheet/test_cond_format_04.rb +1 -1
- data/test/worksheet/test_cond_format_05.rb +1 -1
- data/test/worksheet/test_cond_format_06.rb +1 -1
- data/test/worksheet/test_cond_format_07.rb +1 -1
- data/test/worksheet/test_cond_format_08.rb +1 -1
- data/test/worksheet/test_cond_format_09.rb +1 -1
- data/test/worksheet/test_cond_format_10.rb +1 -1
- data/test/worksheet/test_cond_format_11.rb +1 -1
- data/test/worksheet/test_cond_format_12.rb +1 -1
- data/test/worksheet/test_cond_format_13.rb +1 -1
- data/test/worksheet/test_cond_format_14.rb +1 -1
- data/test/worksheet/test_cond_format_15.rb +1 -1
- data/test/worksheet/test_cond_format_16.rb +1 -1
- data/test/worksheet/test_cond_format_17.rb +1 -1
- data/test/worksheet/test_cond_format_18.rb +1 -1
- data/test/worksheet/test_cond_format_19.rb +1 -1
- data/test/worksheet/test_cond_format_20.rb +1 -1
- data/test/worksheet/test_cond_format_21.rb +90 -0
- data/test/worksheet/test_cond_format_22.rb +266 -0
- data/test/worksheet/test_cond_format_23.rb +242 -0
- data/test/worksheet/test_cond_format_24.rb +303 -0
- data/test/worksheet/test_convert_date_time_01.rb +1 -1
- data/test/worksheet/test_convert_date_time_02.rb +1 -1
- data/test/worksheet/test_convert_date_time_03.rb +1 -1
- data/test/worksheet/test_convert_date_time_04.rb +1 -1
- data/test/worksheet/test_data_bar_01.rb +53 -0
- data/test/worksheet/test_data_bar_02.rb +79 -0
- data/test/worksheet/test_data_bar_03.rb +147 -0
- data/test/worksheet/test_data_bar_04.rb +145 -0
- data/test/worksheet/test_data_bar_05.rb +147 -0
- data/test/worksheet/test_data_bar_06.rb +145 -0
- data/test/worksheet/test_data_bar_07.rb +146 -0
- data/test/worksheet/test_data_bar_08.rb +54 -0
- data/test/worksheet/test_data_bar_09.rb +80 -0
- data/test/worksheet/test_data_bar_10.rb +165 -0
- data/test/worksheet/test_data_bar_11.rb +167 -0
- data/test/worksheet/test_data_bar_12.rb +104 -0
- data/test/worksheet/test_extract_filter_tokens.rb +1 -1
- data/test/worksheet/test_parse_filter_expression.rb +1 -1
- data/test/worksheet/test_pixels_to_row_col.rb +46 -0
- data/test/worksheet/test_position_object.rb +1 -1
- data/test/worksheet/test_repeat_formula.rb +1 -1
- data/test/worksheet/test_sparkline_01.rb +1 -1
- data/test/worksheet/test_sparkline_02.rb +1 -1
- data/test/worksheet/test_sparkline_03.rb +1 -1
- data/test/worksheet/test_sparkline_04.rb +1 -1
- data/test/worksheet/test_sparkline_05.rb +1 -1
- data/test/worksheet/test_sparkline_06.rb +1 -1
- data/test/worksheet/test_sparkline_07.rb +1 -1
- data/test/worksheet/test_sparkline_08.rb +1 -1
- data/test/worksheet/test_sparkline_09.rb +1 -1
- data/test/worksheet/test_sparkline_10.rb +1 -1
- data/test/worksheet/test_sparkline_11.rb +1 -1
- data/test/worksheet/test_sparkline_12.rb +94 -0
- data/test/worksheet/test_update_format_methods.rb +91 -0
- data/test/worksheet/test_worksheet_01.rb +1 -1
- data/test/worksheet/test_worksheet_02.rb +1 -1
- data/test/worksheet/test_worksheet_03.rb +1 -1
- data/test/worksheet/test_worksheet_04.rb +1 -1
- data/test/worksheet/test_write_array_formula_01.rb +1 -8
- data/test/worksheet/test_write_autofilter.rb +1 -1
- data/test/worksheet/test_write_brk.rb +1 -1
- data/test/worksheet/test_write_cell.rb +1 -1
- data/test/worksheet/test_write_cell_value.rb +1 -1
- data/test/worksheet/test_write_col_breaks.rb +1 -1
- data/test/worksheet/test_write_col_info.rb +1 -1
- data/test/worksheet/test_write_conditional_formatting.rb +1 -1
- data/test/worksheet/test_write_custom_filter.rb +1 -1
- data/test/worksheet/test_write_custom_filters.rb +1 -1
- data/test/worksheet/test_write_data_validation_01.rb +1 -1
- data/test/worksheet/test_write_data_validation_02.rb +59 -2
- data/test/worksheet/test_write_dimension.rb +1 -1
- data/test/worksheet/test_write_filter.rb +1 -1
- data/test/worksheet/test_write_filter_column.rb +1 -1
- data/test/worksheet/test_write_filters.rb +1 -1
- data/test/worksheet/test_write_formula_does_not_change_formula_string.rb +1 -1
- data/test/worksheet/test_write_header_footer.rb +1 -1
- data/test/worksheet/test_write_hyperlink.rb +1 -8
- data/test/worksheet/test_write_legacy_drawing.rb +1 -1
- data/test/worksheet/test_write_merge_cell.rb +1 -1
- data/test/worksheet/test_write_merge_cells.rb +1 -1
- data/test/worksheet/test_write_methods.rb +68 -177
- data/test/worksheet/test_write_page_margins.rb +1 -1
- data/test/worksheet/test_write_page_set_up_pr.rb +1 -1
- data/test/worksheet/test_write_page_setup.rb +1 -1
- data/test/worksheet/test_write_pane.rb +1 -1
- data/test/worksheet/test_write_phonetic_pr.rb +1 -1
- data/test/worksheet/test_write_print_options.rb +1 -1
- data/test/worksheet/test_write_row_breaks.rb +1 -1
- data/test/worksheet/test_write_row_element.rb +1 -1
- data/test/worksheet/test_write_selection.rb +1 -1
- data/test/worksheet/test_write_sheet_calc_pr.rb +1 -1
- data/test/worksheet/test_write_sheet_data.rb +1 -1
- data/test/worksheet/test_write_sheet_format_pr.rb +1 -1
- data/test/worksheet/test_write_sheet_pr.rb +1 -1
- data/test/worksheet/test_write_sheet_protection.rb +1 -1
- data/test/worksheet/test_write_sheet_view.rb +20 -2
- data/test/worksheet/test_write_sheet_view1.rb +1 -1
- data/test/worksheet/test_write_sheet_view2.rb +1 -1
- data/test/worksheet/test_write_sheet_view3.rb +1 -1
- data/test/worksheet/test_write_sheet_view4.rb +1 -1
- data/test/worksheet/test_write_sheet_view5.rb +1 -1
- data/test/worksheet/test_write_sheet_view6.rb +1 -1
- data/test/worksheet/test_write_sheet_view7.rb +1 -1
- data/test/worksheet/test_write_sheet_view8.rb +1 -1
- data/test/worksheet/test_write_sheet_view9.rb +1 -1
- data/test/worksheet/test_write_tab_color.rb +1 -1
- data/test/worksheet/test_write_worksheet_attributes.rb +1 -1
- data/write_xlsx.gemspec +4 -3
- metadata +937 -18
- data/test/package/comments/test_write_text_t.rb +0 -44
- data/test/test_col_name.rb +0 -13
- data/test/workbook/test_workbook_new.rb +0 -18
- data/test/worksheet/test_write_multiline_string_with_url.rb +0 -30
- data/test/worksheet/test_write_url.rb +0 -19
data/lib/write_xlsx/workbook.rb
CHANGED
@@ -19,77 +19,25 @@ module Writexlsx
|
|
19
19
|
|
20
20
|
OFFICE_URL = 'http://schemas.microsoft.com/office/' # :nodoc:
|
21
21
|
|
22
|
-
# The WriteXLSX provides an object oriented interface to a new Excel workbook.
|
23
|
-
# The following methods are available through a new workbook.
|
24
|
-
#
|
25
|
-
# * new[#method-c-new]
|
26
|
-
# * add_worksheet[#method-i-add_worksheet]
|
27
|
-
# * add_format[#method-i-add_format]
|
28
|
-
# * add_chart[#method-i-add_chart]
|
29
|
-
# * add_shape[#method-i-add_shape]
|
30
|
-
# * add_vba_project[#method-i-add_vba_project]
|
31
|
-
# * close[#method-i-close]
|
32
|
-
# * set_properties[#method-i-set_properties]
|
33
|
-
# * define_name[#method-i-define_name]
|
34
|
-
# * set_custom_color[#method-i-set_custom_color]
|
35
|
-
# * sheets[#method-i-sheets]
|
36
|
-
# * set_1904[#method-i-set_1904]
|
37
|
-
#
|
38
22
|
class Workbook
|
39
23
|
|
40
24
|
include Writexlsx::Utility
|
41
25
|
|
42
|
-
attr_writer :firstsheet
|
43
|
-
attr_reader :palette
|
44
|
-
attr_reader :worksheets, :charts, :drawings
|
45
|
-
attr_reader :named_ranges
|
46
|
-
attr_reader :doc_properties
|
47
|
-
attr_reader :
|
48
|
-
attr_reader :
|
49
|
-
attr_reader :
|
50
|
-
attr_reader :
|
51
|
-
attr_reader :
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
|
57
|
-
# workbook = WriteXLSX.new('filename.xlsx')
|
58
|
-
# worksheet = workbook.add_worksheet
|
59
|
-
# worksheet.write(0, 0, 'Hi Excel!')
|
60
|
-
# workbook.close
|
61
|
-
#
|
62
|
-
# Here are some other examples of using +new+ with filenames:
|
63
|
-
#
|
64
|
-
# workbook1 = WriteXLSX.new(filename)
|
65
|
-
# workbook2 = WriteXLSX.new('/tmp/filename.xlsx')
|
66
|
-
# workbook3 = WriteXLSX.new("c:\\tmp\\filename.xlsx")
|
67
|
-
# workbook4 = WriteXLSX.new('c:\tmp\filename.xlsx')
|
68
|
-
#
|
69
|
-
# The last two examples demonstrates how to create a file on DOS or Windows
|
70
|
-
# where it is necessary to either escape the directory separator \
|
71
|
-
# or to use single quotes to ensure that it isn't interpolated.
|
72
|
-
#
|
73
|
-
# It is recommended that the filename uses the extension .xlsx
|
74
|
-
# rather than .xls since the latter causes an Excel warning
|
75
|
-
# when used with the XLSX format.
|
76
|
-
#
|
77
|
-
# The +new+ constructor returns a WriteXLSX object that you can use to
|
78
|
-
# add worksheets and store data.
|
79
|
-
#
|
80
|
-
# You can also pass a valid IO object to the +new+ constructor.
|
81
|
-
#
|
82
|
-
# xlsx = StringIO.new
|
83
|
-
# workbook = WriteXLSX.new(xlsx)
|
84
|
-
# ....
|
85
|
-
# workbook.close
|
86
|
-
# # you can get XLSX binary data as xlsx.string
|
87
|
-
#
|
88
|
-
# And you can pass default_formats parameter like this:
|
89
|
-
#
|
90
|
-
# formats = { :font => 'Arial', :size => 10.5 }
|
91
|
-
# workbook = WriteXLSX.new('file.xlsx', formats)
|
92
|
-
#
|
26
|
+
attr_writer :firstsheet # :nodoc:
|
27
|
+
attr_reader :palette # :nodoc:
|
28
|
+
attr_reader :worksheets, :charts, :drawings # :nodoc:
|
29
|
+
attr_reader :named_ranges # :nodoc:
|
30
|
+
attr_reader :doc_properties # :nodoc:
|
31
|
+
attr_reader :custom_properties # :nodoc:
|
32
|
+
attr_reader :image_types, :images # :nodoc:
|
33
|
+
attr_reader :shared_strings # :nodoc:
|
34
|
+
attr_reader :vba_project # :nodoc:
|
35
|
+
attr_reader :excel2003_style # :nodoc:
|
36
|
+
attr_reader :max_url_length # :nodoc:
|
37
|
+
attr_reader :strings_to_urls # :nodoc:
|
38
|
+
attr_reader :default_url_format # :nodoc:
|
39
|
+
attr_reader :read_only # :nodoc:
|
40
|
+
|
93
41
|
def initialize(file, *option_params)
|
94
42
|
options, default_formats = process_workbook_options(*option_params)
|
95
43
|
@writer = Package::XMLWriterSimple.new
|
@@ -114,19 +62,28 @@ module Writexlsx
|
|
114
62
|
@named_ranges = []
|
115
63
|
@custom_colors = []
|
116
64
|
@doc_properties = {}
|
117
|
-
@
|
65
|
+
@custom_properties = []
|
118
66
|
@optimization = options[:optimization] || 0
|
119
67
|
@x_window = 240
|
120
68
|
@y_window = 15
|
121
69
|
@window_width = 16095
|
122
70
|
@window_height = 9660
|
123
|
-
@tab_ratio =
|
71
|
+
@tab_ratio = 600
|
124
72
|
@excel2003_style = options[:excel2003_style] || false
|
125
73
|
@table_count = 0
|
126
74
|
@image_types = {}
|
127
75
|
@images = []
|
128
76
|
@strings_to_urls = (options[:strings_to_urls].nil? || options[:strings_to_urls]) ? true : false
|
129
77
|
|
78
|
+
@max_url_length = 2079
|
79
|
+
@has_comments = false
|
80
|
+
@read_only = 0
|
81
|
+
@has_metadata = false
|
82
|
+
if options[:max_url_length]
|
83
|
+
@max_url_length = options[:max_url_length]
|
84
|
+
|
85
|
+
@max_url_length = 2079 if @max_url_length < 250
|
86
|
+
end
|
130
87
|
# Structures for the shared strings data.
|
131
88
|
@shared_strings = Package::SharedStrings.new
|
132
89
|
|
@@ -136,24 +93,26 @@ module Writexlsx
|
|
136
93
|
@calc_on_load = true
|
137
94
|
|
138
95
|
if @excel2003_style
|
139
|
-
add_format(default_formats
|
140
|
-
|
96
|
+
add_format(default_formats.merge(
|
97
|
+
:xf_index => 0,
|
98
|
+
:font_family => 0,
|
99
|
+
:font => 'Arial',
|
100
|
+
:size => 10,
|
101
|
+
:theme => -1
|
102
|
+
))
|
141
103
|
else
|
142
104
|
add_format(default_formats.merge(:xf_index => 0))
|
143
105
|
end
|
106
|
+
|
107
|
+
# Add a default URL format.
|
108
|
+
@default_url_format = add_format(:hyperlink => 1)
|
109
|
+
|
144
110
|
set_color_palette
|
145
111
|
end
|
146
112
|
|
147
113
|
#
|
148
114
|
# The close method is used to close an Excel file.
|
149
115
|
#
|
150
|
-
# An explicit close is required if the file must be closed prior to performing
|
151
|
-
# some external action on it such as copying it, reading its size or attaching
|
152
|
-
# it to an email.
|
153
|
-
#
|
154
|
-
# In general, if you create a file with a size of 0 bytes or you fail to create
|
155
|
-
# a file you need to call close.
|
156
|
-
#
|
157
116
|
def close
|
158
117
|
# In case close() is called twice.
|
159
118
|
return if @fileclosed
|
@@ -169,32 +128,6 @@ module Writexlsx
|
|
169
128
|
# sheets -> array of all Wordsheet object
|
170
129
|
# sheets(1, 3, 4) -> array of spcified Worksheet object.
|
171
130
|
#
|
172
|
-
# The sheets method returns a array, or a sliced array, of the worksheets
|
173
|
-
# in a workbook.
|
174
|
-
#
|
175
|
-
# If no arguments are passed the method returns a list of all the worksheets
|
176
|
-
# in the workbook. This is useful if you want to repeat an operation on each
|
177
|
-
# worksheet:
|
178
|
-
#
|
179
|
-
# workbook.sheets.each do |worksheet|
|
180
|
-
# print worksheet.get_name
|
181
|
-
# end
|
182
|
-
#
|
183
|
-
# You can also specify a slice list to return one or more worksheet objects:
|
184
|
-
#
|
185
|
-
# worksheet = workbook.sheets(0)
|
186
|
-
# worksheet.write('A1', 'Hello')
|
187
|
-
#
|
188
|
-
# you can write the above example as:
|
189
|
-
#
|
190
|
-
# workbook.sheets(0).write('A1', 'Hello')
|
191
|
-
#
|
192
|
-
# The following example returns the first and last worksheet in a workbook:
|
193
|
-
#
|
194
|
-
# workbook.sheets(0, -1).each do |sheet|
|
195
|
-
# # Do something
|
196
|
-
# end
|
197
|
-
#
|
198
131
|
def sheets(*args)
|
199
132
|
if args.empty?
|
200
133
|
@worksheets
|
@@ -204,21 +137,15 @@ module Writexlsx
|
|
204
137
|
end
|
205
138
|
|
206
139
|
#
|
207
|
-
#
|
208
|
-
#
|
209
|
-
# Excel stores dates as real numbers where the integer part stores
|
210
|
-
# the number of days since the epoch and the fractional part stores
|
211
|
-
# the percentage of the day. The epoch can be either 1900 or 1904.
|
212
|
-
# Excel for Windows uses 1900 and Excel for Macintosh uses 1904.
|
213
|
-
# However, Excel on either platform will convert automatically between
|
214
|
-
# one system and the other.
|
140
|
+
# Return a worksheet object in the workbook using the sheetname.
|
215
141
|
#
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
142
|
+
def worksheet_by_name(sheetname = nil)
|
143
|
+
sheets.select { |s| s.name == sheetname }.first
|
144
|
+
end
|
145
|
+
alias get_worksheet_by_name worksheet_by_name
|
146
|
+
|
220
147
|
#
|
221
|
-
#
|
148
|
+
# Set the date system: false = 1900 (the default), true = 1904
|
222
149
|
#
|
223
150
|
def set_1904(mode = true)
|
224
151
|
unless sheets.empty?
|
@@ -269,6 +196,9 @@ module Writexlsx
|
|
269
196
|
# Write the XLSX file version.
|
270
197
|
write_file_version
|
271
198
|
|
199
|
+
# Write the fileSharing element.
|
200
|
+
write_file_sharing
|
201
|
+
|
272
202
|
# Write the workbook properties.
|
273
203
|
write_workbook_pr
|
274
204
|
|
@@ -293,20 +223,6 @@ module Writexlsx
|
|
293
223
|
#
|
294
224
|
# At least one worksheet should be added to a new workbook. A worksheet is used to write data into cells:
|
295
225
|
#
|
296
|
-
# worksheet1 = workbook.add_worksheet # Sheet1
|
297
|
-
# worksheet2 = workbook.add_worksheet('Foglio2') # Foglio2
|
298
|
-
# worksheet3 = workbook.add_worksheet('Data') # Data
|
299
|
-
# worksheet4 = workbook.add_worksheet # Sheet4
|
300
|
-
# If name is not specified the default Excel convention will be followed, i.e. Sheet1, Sheet2, etc.
|
301
|
-
#
|
302
|
-
# The worksheet name must be a valid Excel worksheet name,
|
303
|
-
# i.e. it cannot contain any of the following characters,
|
304
|
-
# [ ] : * ? / \
|
305
|
-
#
|
306
|
-
# and it must be less than 32 characters.
|
307
|
-
# In addition, you cannot use the same, case insensitive,
|
308
|
-
# sheetname for more than one worksheet.
|
309
|
-
#
|
310
226
|
def add_worksheet(name = '')
|
311
227
|
name = check_sheetname(name)
|
312
228
|
worksheet = Worksheet.new(self, @worksheets.size, name)
|
@@ -317,72 +233,7 @@ module Writexlsx
|
|
317
233
|
#
|
318
234
|
# This method is use to create a new chart either as a standalone worksheet
|
319
235
|
# (the default) or as an embeddable object that can be inserted into
|
320
|
-
# a worksheet via the
|
321
|
-
# {Worksheet#insert_chart}[Worksheet.html#method-i-insert_chart] method.
|
322
|
-
#
|
323
|
-
# chart = workbook.add_chart(:type => 'column')
|
324
|
-
#
|
325
|
-
# The properties that can be set are:
|
326
|
-
#
|
327
|
-
# :type (required)
|
328
|
-
# :subtype (optional)
|
329
|
-
# :name (optional)
|
330
|
-
# :embedded (optional)
|
331
|
-
#
|
332
|
-
# === :type
|
333
|
-
#
|
334
|
-
# This is a required parameter.
|
335
|
-
# It defines the type of chart that will be created.
|
336
|
-
#
|
337
|
-
# chart = workbook.add_chart(:type => 'line')
|
338
|
-
#
|
339
|
-
# The available types are:
|
340
|
-
#
|
341
|
-
# area
|
342
|
-
# bar
|
343
|
-
# column
|
344
|
-
# line
|
345
|
-
# pie
|
346
|
-
# scatter
|
347
|
-
# stock
|
348
|
-
#
|
349
|
-
# === :subtype
|
350
|
-
#
|
351
|
-
# Used to define a chart subtype where available.
|
352
|
-
#
|
353
|
-
# chart = workbook.add_chart(:type => 'bar', :subtype => 'stacked')
|
354
|
-
#
|
355
|
-
# Currently only Bar and Column charts support subtypes
|
356
|
-
# (stacked and percent_stacked). See the documentation for those chart
|
357
|
-
# types.
|
358
|
-
#
|
359
|
-
# === :name
|
360
|
-
#
|
361
|
-
# Set the name for the chart sheet. The name property is optional and
|
362
|
-
# if it isn't supplied will default to Chart1 .. n. The name must be
|
363
|
-
# a valid Excel worksheet name. See add_worksheet
|
364
|
-
# for more details on valid sheet names. The name property can be
|
365
|
-
# omitted for embedded charts.
|
366
|
-
#
|
367
|
-
# chart = workbook.add_chart(:type => 'line', :name => 'Results Chart')
|
368
|
-
#
|
369
|
-
# === :embedded
|
370
|
-
#
|
371
|
-
# Specifies that the Chart object will be inserted in a worksheet
|
372
|
-
# via the {Worksheet#insert_chart}[Worksheet.html#insert_chart] method.
|
373
|
-
# It is an error to try insert a Chart that doesn't have this flag set.
|
374
|
-
#
|
375
|
-
# chart = workbook.add_chart(:type => 'line', :embedded => 1)
|
376
|
-
#
|
377
|
-
# # Configure the chart.
|
378
|
-
# ...
|
379
|
-
#
|
380
|
-
# # Insert the chart into the a worksheet.
|
381
|
-
# worksheet.insert_chart('E2', chart)
|
382
|
-
#
|
383
|
-
# See Chart[Chart.html] for details on how to configure the chart object
|
384
|
-
# once it is created. See also the chart_*.rb programs in the examples
|
385
|
-
# directory of the distro.
|
236
|
+
# a worksheet via the insert_chart method.
|
386
237
|
#
|
387
238
|
def add_chart(params = {})
|
388
239
|
# Type must be specified so we can create the required chart instance.
|
@@ -414,7 +265,7 @@ module Writexlsx
|
|
414
265
|
end
|
415
266
|
|
416
267
|
#
|
417
|
-
# The
|
268
|
+
# The add_format method can be used to create new Format objects
|
418
269
|
# which are used to apply formatting to a cell. You can either define
|
419
270
|
# the properties at creation time via a hash of property values
|
420
271
|
# or later via method calls.
|
@@ -422,9 +273,6 @@ module Writexlsx
|
|
422
273
|
# format1 = workbook.add_format(property_hash) # Set properties at creation
|
423
274
|
# format2 = workbook.add_format # Set properties later
|
424
275
|
#
|
425
|
-
# See the {Format Class's rdoc}[Format.html] for more details about
|
426
|
-
# Format properties and how to set them.
|
427
|
-
#
|
428
276
|
def add_format(property_hash = {})
|
429
277
|
properties = {}
|
430
278
|
if @excel2003_style
|
@@ -443,236 +291,6 @@ module Writexlsx
|
|
443
291
|
# The +add_shape+ method can be used to create new shapes that may be
|
444
292
|
# inserted into a worksheet.
|
445
293
|
#
|
446
|
-
# You can either define the properties at creation time via a hash of
|
447
|
-
# property values or later via method calls.
|
448
|
-
#
|
449
|
-
# # Set properties at creation.
|
450
|
-
# plus = workbook.add_shape(
|
451
|
-
# :type => 'plus',
|
452
|
-
# :id => 3,
|
453
|
-
# :width => pw,
|
454
|
-
# :height => ph
|
455
|
-
# )
|
456
|
-
#
|
457
|
-
# # Default rectangle shape. Set properties later.
|
458
|
-
# rect = workbook.add_shape
|
459
|
-
#
|
460
|
-
# See also the shape*.rb programs in the examples directory of the distro.
|
461
|
-
#
|
462
|
-
# === Shape Properties
|
463
|
-
#
|
464
|
-
# Any shape property can be queried or modified by [ ] like hash.
|
465
|
-
#
|
466
|
-
# ellipse = workbook.add_shape(properties)
|
467
|
-
# ellipse[:type] = 'cross' # No longer an ellipse !
|
468
|
-
# type = ellipse[:type] # Find out what it really is.
|
469
|
-
#
|
470
|
-
# The properties of a shape object that can be defined via add_shape are
|
471
|
-
# shown below.
|
472
|
-
#
|
473
|
-
# ===:name
|
474
|
-
#
|
475
|
-
# Defines the name of the shape. This is an optional property and the shape
|
476
|
-
# will be given a default name if not supplied. The name is generally only
|
477
|
-
# used by Excel Macros to refer to the object.
|
478
|
-
#
|
479
|
-
# ===:type
|
480
|
-
#
|
481
|
-
# Defines the type of the object such as +:rect+, +:ellipse+ OR +:triangle+.
|
482
|
-
#
|
483
|
-
# ellipse = workbook.add_shape(:type => :ellipse)
|
484
|
-
#
|
485
|
-
# The default type is +:rect+.
|
486
|
-
#
|
487
|
-
# The full list of available shapes is shown below.
|
488
|
-
#
|
489
|
-
# See also the shape_all.rb program in the examples directory of the distro.
|
490
|
-
# It creates an example workbook with all supported shapes labelled with
|
491
|
-
# their shape names.
|
492
|
-
#
|
493
|
-
# === Basic Shapes
|
494
|
-
#
|
495
|
-
# blockArc can chevron cube decagon
|
496
|
-
# diamond dodecagon donut ellipse funnel
|
497
|
-
# gear6 gear9 heart heptagon hexagon
|
498
|
-
# homePlate lightningBolt line lineInv moon
|
499
|
-
# nonIsoscelesTrapezoid noSmoking octagon parallelogram pentagon
|
500
|
-
# pie pieWedge plaque rect round1Rect
|
501
|
-
# round2DiagRect round2SameRect roundRect rtTriangle smileyFace
|
502
|
-
# snip1Rect snip2DiagRect snip2SameRect snipRoundRect star10
|
503
|
-
# star12 star16 star24 star32 star4
|
504
|
-
# star5 star6 star7 star8 sun
|
505
|
-
# teardrop trapezoid triangle
|
506
|
-
#
|
507
|
-
# === Arrow Shapes
|
508
|
-
#
|
509
|
-
# bentArrow bentUpArrow circularArrow curvedDownArrow
|
510
|
-
# curvedLeftArrow curvedRightArrow curvedUpArrow downArrow
|
511
|
-
# leftArrow leftCircularArrow leftRightArrow leftRightCircularArrow
|
512
|
-
# leftRightUpArrow leftUpArrow notchedRightArrow quadArrow
|
513
|
-
# rightArrow stripedRightArrow swooshArrow upArrow
|
514
|
-
# upDownArrow uturnArrow
|
515
|
-
#
|
516
|
-
# === Connector Shapes
|
517
|
-
#
|
518
|
-
# bentConnector2 bentConnector3 bentConnector4
|
519
|
-
# bentConnector5 curvedConnector2 curvedConnector3
|
520
|
-
# curvedConnector4 curvedConnector5 straightConnector1
|
521
|
-
#
|
522
|
-
# === Callout Shapes
|
523
|
-
#
|
524
|
-
# accentBorderCallout1 accentBorderCallout2 accentBorderCallout3
|
525
|
-
# accentCallout1 accentCallout2 accentCallout3
|
526
|
-
# borderCallout1 borderCallout2 borderCallout3
|
527
|
-
# callout1 callout2 callout3
|
528
|
-
# cloudCallout downArrowCallout leftArrowCallout
|
529
|
-
# leftRightArrowCallout quadArrowCallout rightArrowCallout
|
530
|
-
# upArrowCallout upDownArrowCallout wedgeEllipseCallout
|
531
|
-
# wedgeRectCallout wedgeRoundRectCallout
|
532
|
-
#
|
533
|
-
# === Flow Chart Shapes
|
534
|
-
#
|
535
|
-
# flowChartAlternateProcess flowChartCollate flowChartConnector
|
536
|
-
# flowChartDecision flowChartDelay flowChartDisplay
|
537
|
-
# flowChartDocument flowChartExtract flowChartInputOutput
|
538
|
-
# flowChartInternalStorage flowChartMagneticDisk flowChartMagneticDrum
|
539
|
-
# flowChartMagneticTape flowChartManualInput flowChartManualOperation
|
540
|
-
# flowChartMerge flowChartMultidocument flowChartOfflineStorage
|
541
|
-
# flowChartOffpageConnector flowChartOnlineStorage flowChartOr
|
542
|
-
# flowChartPredefinedProcess flowChartPreparation flowChartProcess
|
543
|
-
# flowChartPunchedCard flowChartPunchedTape flowChartSort
|
544
|
-
# flowChartSummingJunction flowChartTerminator
|
545
|
-
#
|
546
|
-
# === Action Shapes
|
547
|
-
#
|
548
|
-
# actionButtonBackPrevious actionButtonBeginning actionButtonBlank
|
549
|
-
# actionButtonDocument actionButtonEnd actionButtonForwardNext
|
550
|
-
# actionButtonHelp actionButtonHome actionButtonInformation
|
551
|
-
# actionButtonMovie actionButtonReturn actionButtonSound
|
552
|
-
#
|
553
|
-
# === Chart Shapes
|
554
|
-
#
|
555
|
-
# Not to be confused with Excel Charts.
|
556
|
-
#
|
557
|
-
# chartPlus chartStar chartX
|
558
|
-
#
|
559
|
-
# === Math Shapes
|
560
|
-
#
|
561
|
-
# mathDivide mathEqual mathMinus mathMultiply mathNotEqual mathPlus
|
562
|
-
#
|
563
|
-
# === Starts and Banners
|
564
|
-
#
|
565
|
-
# arc bevel bracePair bracketPair chord
|
566
|
-
# cloud corner diagStripe doubleWave ellipseRibbon
|
567
|
-
# ellipseRibbon2 foldedCorner frame halfFrame horizontalScroll
|
568
|
-
# irregularSeal1 irregularSeal2 leftBrace leftBracket leftRightRibbon
|
569
|
-
# plus ribbon ribbon2 rightBrace rightBracket
|
570
|
-
# verticalScroll wave
|
571
|
-
#
|
572
|
-
# === Tab Shapes
|
573
|
-
#
|
574
|
-
# cornerTabs plaqueTabs squareTabs
|
575
|
-
#
|
576
|
-
# === :text
|
577
|
-
#
|
578
|
-
# This property is used to make the shape act like a text box.
|
579
|
-
#
|
580
|
-
# rect = workbook.add_shape(:type => 'rect', :text => "Hello \nWorld")
|
581
|
-
#
|
582
|
-
# The Text is super-imposed over the shape. The text can be wrapped using
|
583
|
-
# the newline character \n.
|
584
|
-
#
|
585
|
-
# === :id
|
586
|
-
#
|
587
|
-
# Identification number for internal identification. This number will be
|
588
|
-
# auto-assigned, if not assigned, or if it is a duplicate.
|
589
|
-
#
|
590
|
-
# === :format
|
591
|
-
#
|
592
|
-
# Workbook format for decorating the shape horizontally and/or vertically.
|
593
|
-
#
|
594
|
-
# === :rotation
|
595
|
-
#
|
596
|
-
# Shape rotation, in degrees, from 0 to 360
|
597
|
-
#
|
598
|
-
# === :line, :fill
|
599
|
-
#
|
600
|
-
# Shape color for the outline and fill.
|
601
|
-
# Colors may be specified as a color index, or in RGB format, i.e. AA00FF.
|
602
|
-
#
|
603
|
-
# See COULOURS IN EXCEL in the main documentation for more information.
|
604
|
-
#
|
605
|
-
# === :link_type
|
606
|
-
#
|
607
|
-
# Line type for shape outline. The default is solid.
|
608
|
-
# The list of possible values is:
|
609
|
-
#
|
610
|
-
# dash, sysDot, dashDot, lgDash, lgDashDot, lgDashDotDot, solid
|
611
|
-
#
|
612
|
-
# === :valign, :align
|
613
|
-
#
|
614
|
-
# Text alignment within the shape.
|
615
|
-
#
|
616
|
-
# Vertical alignment can be:
|
617
|
-
#
|
618
|
-
# Setting Meaning
|
619
|
-
# ======= =======
|
620
|
-
# t Top
|
621
|
-
# ctr Centre
|
622
|
-
# b Bottom
|
623
|
-
#
|
624
|
-
# Horizontal alignment can be:
|
625
|
-
#
|
626
|
-
# Setting Meaning
|
627
|
-
# ======= =======
|
628
|
-
# l Left
|
629
|
-
# r Right
|
630
|
-
# ctr Centre
|
631
|
-
# just Justified
|
632
|
-
#
|
633
|
-
# The default is to center both horizontally and vertically.
|
634
|
-
#
|
635
|
-
# === :scale_x, :scale_y
|
636
|
-
#
|
637
|
-
# Scale factor in x and y dimension, for scaling the shape width and
|
638
|
-
# height. The default value is 1.
|
639
|
-
#
|
640
|
-
# Scaling may be set on the shape object or via insert_shape.
|
641
|
-
#
|
642
|
-
# === :adjustments
|
643
|
-
#
|
644
|
-
# Adjustment of shape vertices. Most shapes do not use this. For some
|
645
|
-
# shapes, there is a single adjustment to modify the geometry.
|
646
|
-
# For instance, the plus shape has one adjustment to control the width
|
647
|
-
# of the spokes.
|
648
|
-
#
|
649
|
-
# Connectors can have a number of adjustments to control the shape
|
650
|
-
# routing. Typically, a connector will have 3 to 5 handles for routing
|
651
|
-
# the shape. The adjustment is in percent of the distance from the
|
652
|
-
# starting shape to the ending shape, alternating between the x and y
|
653
|
-
# dimension. Adjustments may be negative, to route the shape away
|
654
|
-
# from the endpoint.
|
655
|
-
#
|
656
|
-
# === :stencil
|
657
|
-
#
|
658
|
-
# Shapes work in stencil mode by default. That is, once a shape is
|
659
|
-
# inserted, its connection is separated from its master.
|
660
|
-
# The master shape may be modified after an instance is inserted,
|
661
|
-
# and only subsequent insertions will show the modifications.
|
662
|
-
#
|
663
|
-
# This is helpful for Org charts, where an employee shape may be
|
664
|
-
# created once, and then the text of the shape is modified for each
|
665
|
-
# employee.
|
666
|
-
#
|
667
|
-
# The insert_shape method returns a reference to the inserted
|
668
|
-
# shape (the child).
|
669
|
-
#
|
670
|
-
# Stencil mode can be turned off, allowing for shape(s) to be
|
671
|
-
# modified after insertion. In this case the insert_shape() method
|
672
|
-
# returns a reference to the inserted shape (the master).
|
673
|
-
# This is not very useful for inserting multiple shapes,
|
674
|
-
# since the x/y coordinates also gets modified.
|
675
|
-
#
|
676
294
|
def add_shape(properties = {})
|
677
295
|
shape = Shape.new(properties)
|
678
296
|
shape.palette = @palette
|
@@ -686,31 +304,6 @@ module Writexlsx
|
|
686
304
|
# Create a defined name in Excel. We handle global/workbook level names and
|
687
305
|
# local/worksheet names.
|
688
306
|
#
|
689
|
-
# This method is used to defined a name that can be used to represent
|
690
|
-
# a value, a single cell or a range of cells in a workbook.
|
691
|
-
#
|
692
|
-
# For example to set a global/workbook name:
|
693
|
-
#
|
694
|
-
# # Global/workbook names.
|
695
|
-
# workbook.define_name('Exchange_rate', '=0.96')
|
696
|
-
# workbook.define_name('Sales', '=Sheet1!$G$1:$H$10')
|
697
|
-
#
|
698
|
-
# It is also possible to define a local/worksheet name by prefixing the name
|
699
|
-
# with the sheet name using the syntax +sheetname!definedname+:
|
700
|
-
#
|
701
|
-
# # Local/worksheet name.
|
702
|
-
# workbook.define_name('Sheet2!Sales', '=Sheet2!$G$1:$G$10')
|
703
|
-
#
|
704
|
-
# If the sheet name contains spaces or special characters
|
705
|
-
# you must enclose it in single quotes like in Excel:
|
706
|
-
#
|
707
|
-
# workbook.define_name("'New Data'!Sales", '=Sheet2!$G$1:$G$10')
|
708
|
-
#
|
709
|
-
# See the defined_name.rb program in the examples dir of the distro.
|
710
|
-
#
|
711
|
-
# Refer to the following to see Excel's syntax rules for defined names:
|
712
|
-
# <http://office.microsoft.com/en-001/excel-help/define-and-use-names-in-formulas-HA010147120.aspx#BMsyntax_rules_for_names>
|
713
|
-
#
|
714
307
|
def define_name(name, formula)
|
715
308
|
sheet_index = nil
|
716
309
|
sheetname = ''
|
@@ -726,7 +319,7 @@ module Writexlsx
|
|
726
319
|
|
727
320
|
# Raise if the sheet index wasn't found.
|
728
321
|
if !sheet_index
|
729
|
-
raise "Unknown sheet name #{sheetname} in defined_name()
|
322
|
+
raise "Unknown sheet name #{sheetname} in defined_name()"
|
730
323
|
end
|
731
324
|
|
732
325
|
# Raise if the name contains invalid chars as defined by Excel help.
|
@@ -734,22 +327,54 @@ module Writexlsx
|
|
734
327
|
# http://office.microsoft.com/en-001/excel-help/define-and-use-names-in-formulas-HA010147120.aspx#BMsyntax_rules_for_names
|
735
328
|
#
|
736
329
|
if name =~ /\A[-0-9 !"#\$%&'\(\)\*\+,\.:;<=>\?@\[\]\^`\{\}~]/ || name =~ /.+[- !"#\$%&'\(\)\*\+,\\:;<=>\?@\[\]\^`\{\}~]/
|
737
|
-
raise "Invalid characters in name '#{name}' used in defined_name()
|
330
|
+
raise "Invalid characters in name '#{name}' used in defined_name()"
|
738
331
|
end
|
739
332
|
|
740
333
|
# Raise if the name looks like a cell name.
|
741
334
|
if name =~ %r(^[a-zA-Z][a-zA-Z]?[a-dA-D]?[0-9]+$)
|
742
|
-
raise "Invalid name '#{name}' looks like a cell name in defined_name()
|
335
|
+
raise "Invalid name '#{name}' looks like a cell name in defined_name()"
|
743
336
|
end
|
744
337
|
|
745
338
|
# Raise if the name looks like a R1C1
|
746
339
|
if name =~ /\A[rcRC]\Z/ || name =~ /\A[rcRC]\d+[rcRC]\d+\Z/
|
747
|
-
raise "Invalid name '#{name}' like a RC cell ref in defined_name()
|
340
|
+
raise "Invalid name '#{name}' like a RC cell ref in defined_name()"
|
748
341
|
end
|
749
342
|
|
750
343
|
@defined_names.push([ name, sheet_index, formula.sub(/^=/, '') ])
|
751
344
|
end
|
752
345
|
|
346
|
+
#
|
347
|
+
# Set the workbook size.
|
348
|
+
#
|
349
|
+
def set_size(width = nil, height = nil)
|
350
|
+
if ptrue?(width)
|
351
|
+
# Convert to twips at 96 dpi.
|
352
|
+
@window_width = width.to_i * 1440 / 96
|
353
|
+
else
|
354
|
+
@window_width = 16095
|
355
|
+
end
|
356
|
+
|
357
|
+
if ptrue?(height)
|
358
|
+
# Convert to twips at 96 dpi.
|
359
|
+
@window_height = height.to_i * 1440 / 96
|
360
|
+
else
|
361
|
+
@window_height = 9660
|
362
|
+
end
|
363
|
+
end
|
364
|
+
|
365
|
+
#
|
366
|
+
# Set the ratio of space for worksheet tabs.
|
367
|
+
#
|
368
|
+
def set_tab_ratio(tab_ratio = nil)
|
369
|
+
return if !tab_ratio
|
370
|
+
|
371
|
+
if tab_ratio < 0 || tab_ratio > 100
|
372
|
+
raise "Tab ratio outside range: 0 <= zoom <= 100"
|
373
|
+
else
|
374
|
+
@tab_ratio = (tab_ratio * 10).to_i
|
375
|
+
end
|
376
|
+
end
|
377
|
+
|
753
378
|
#
|
754
379
|
# The set_properties method can be used to set the document properties
|
755
380
|
# of the Excel file created by WriteXLSX. These properties are visible
|
@@ -757,46 +382,24 @@ module Writexlsx
|
|
757
382
|
# and are also available to external applications that read or index windows
|
758
383
|
# files.
|
759
384
|
#
|
760
|
-
# The properties should be passed in hash format as follows:
|
761
|
-
#
|
762
|
-
# workbook.set_properties(
|
763
|
-
# :title => 'This is an example spreadsheet',
|
764
|
-
# :author => 'Hideo NAKAMURA',
|
765
|
-
# :comments => 'Created with Ruby and WriteXLSX'
|
766
|
-
# )
|
767
|
-
#
|
768
|
-
# The properties that can be set are:
|
769
|
-
#
|
770
|
-
# :title
|
771
|
-
# :subject
|
772
|
-
# :author
|
773
|
-
# :manager
|
774
|
-
# :company
|
775
|
-
# :category
|
776
|
-
# :keywords
|
777
|
-
# :comments
|
778
|
-
# :status
|
779
|
-
#
|
780
|
-
# See also the properties.rb program in the examples directory
|
781
|
-
# of the distro.
|
782
|
-
#
|
783
385
|
def set_properties(params)
|
784
386
|
# Ignore if no args were passed.
|
785
387
|
return -1 if params.empty?
|
786
388
|
|
787
389
|
# List of valid input parameters.
|
788
390
|
valid = {
|
789
|
-
:title
|
790
|
-
:subject
|
791
|
-
:author
|
792
|
-
:keywords
|
793
|
-
:comments
|
794
|
-
:last_author
|
795
|
-
:created
|
796
|
-
:category
|
797
|
-
:manager
|
798
|
-
:company
|
799
|
-
:status
|
391
|
+
:title => 1,
|
392
|
+
:subject => 1,
|
393
|
+
:author => 1,
|
394
|
+
:keywords => 1,
|
395
|
+
:comments => 1,
|
396
|
+
:last_author => 1,
|
397
|
+
:created => 1,
|
398
|
+
:category => 1,
|
399
|
+
:manager => 1,
|
400
|
+
:company => 1,
|
401
|
+
:status => 1,
|
402
|
+
:hyperlink_base => 1
|
800
403
|
}
|
801
404
|
|
802
405
|
# Check for valid input parameters.
|
@@ -805,37 +408,63 @@ module Writexlsx
|
|
805
408
|
end
|
806
409
|
|
807
410
|
# Set the creation time unless specified by the user.
|
808
|
-
params[:created] = @
|
411
|
+
params[:created] = @createtime unless params.has_key?(:created)
|
809
412
|
|
810
413
|
@doc_properties = params.dup
|
811
414
|
end
|
812
415
|
|
416
|
+
#
|
417
|
+
# Set a user defined custom document property.
|
418
|
+
#
|
419
|
+
def set_custom_property(name, value, type = nil)
|
420
|
+
# Valid types.
|
421
|
+
valid_type = {
|
422
|
+
'text' => 1,
|
423
|
+
'date' => 1,
|
424
|
+
'number' => 1,
|
425
|
+
'number_int' => 1,
|
426
|
+
'bool' => 1,
|
427
|
+
}
|
428
|
+
|
429
|
+
if !name || (type != 'bool' && !value)
|
430
|
+
raise "The name and value parameters must be defined in set_custom_property()"
|
431
|
+
end
|
432
|
+
|
433
|
+
# Determine the type for strings and numbers if it hasn't been specified.
|
434
|
+
if !ptrue?(type)
|
435
|
+
if value =~ /^\d+$/
|
436
|
+
type = 'number_int'
|
437
|
+
elsif value =~
|
438
|
+
/^([+-]?)(?=[0-9]|\.[0-9])[0-9]*(\.[0-9]*)?([Ee]([+-]?[0-9]+))?$/
|
439
|
+
type = 'number'
|
440
|
+
else
|
441
|
+
type = 'text'
|
442
|
+
end
|
443
|
+
end
|
444
|
+
|
445
|
+
# Check for valid validation types.
|
446
|
+
if !valid_type[type]
|
447
|
+
raise "Unknown custom type '$type' in set_custom_property()"
|
448
|
+
end
|
449
|
+
|
450
|
+
# Check for strings longer than Excel's limit of 255 chars.
|
451
|
+
if type == 'text' && value.length > 255
|
452
|
+
raise "Length of text custom value '$value' exceeds Excel's limit of 255 in set_custom_property()"
|
453
|
+
end
|
454
|
+
|
455
|
+
if type == 'bool'
|
456
|
+
value = value ? 1 : 0
|
457
|
+
end
|
458
|
+
|
459
|
+
@custom_properties << [name, value, type]
|
460
|
+
end
|
461
|
+
|
462
|
+
|
813
463
|
#
|
814
464
|
# The add_vba_project method can be used to add macros or functions to an
|
815
465
|
# WriteXLSX file using a binary VBA project file that has been extracted
|
816
466
|
# from an existing Excel xlsm file.
|
817
467
|
#
|
818
|
-
# workbook = WriteXLSX.new('file.xlsm')
|
819
|
-
#
|
820
|
-
# workbook.add_vba_project('./vbaProject.bin')
|
821
|
-
#
|
822
|
-
# The supplied +extract_vba+ utility can be used to extract the required
|
823
|
-
# +vbaProject.bin+ file from an existing Excel file:
|
824
|
-
#
|
825
|
-
# $ extract_vba file.xlsm
|
826
|
-
# Extracted 'vbaProject.bin' successfully
|
827
|
-
#
|
828
|
-
# Macros can be tied to buttons using the worksheet
|
829
|
-
# {insert_button}[Worksheet.html#method-i-insert_button] method
|
830
|
-
# (see the "WORKSHEET METHODS" section for details):
|
831
|
-
#
|
832
|
-
# worksheet.insert_button('C2', { :macro => 'my_macro' })
|
833
|
-
#
|
834
|
-
# Note, Excel uses the file extension xlsm instead of xlsx for files that
|
835
|
-
# contain macros. It is advisable to follow the same convention.
|
836
|
-
#
|
837
|
-
# See also the macros.rb example file.
|
838
|
-
#
|
839
468
|
def add_vba_project(vba_project)
|
840
469
|
@vba_project = vba_project
|
841
470
|
end
|
@@ -851,6 +480,13 @@ module Writexlsx
|
|
851
480
|
end
|
852
481
|
end
|
853
482
|
|
483
|
+
#
|
484
|
+
# Set the Excel "Read-only recommended" save option.
|
485
|
+
#
|
486
|
+
def read_only_recommended
|
487
|
+
@read_only = 2
|
488
|
+
end
|
489
|
+
|
854
490
|
#
|
855
491
|
# set_calc_mode()
|
856
492
|
#
|
@@ -869,61 +505,17 @@ module Writexlsx
|
|
869
505
|
end
|
870
506
|
|
871
507
|
#
|
872
|
-
#
|
873
|
-
#
|
874
|
-
#
|
875
|
-
# palette values with a more suitable colour.
|
876
|
-
#
|
877
|
-
# The value for +index+ should be in the range 8..63,
|
878
|
-
# see "COLOURS IN EXCEL".
|
879
|
-
#
|
880
|
-
# The default named colours use the following indices:
|
508
|
+
# Get the default url format used when a user defined format isn't specified
|
509
|
+
# with write_url(). The format is the hyperlink style defined by Excel for the
|
510
|
+
# default theme.
|
881
511
|
#
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
# 13 => yellow
|
888
|
-
# 14 => magenta
|
889
|
-
# 15 => cyan
|
890
|
-
# 16 => brown
|
891
|
-
# 17 => green
|
892
|
-
# 18 => navy
|
893
|
-
# 20 => purple
|
894
|
-
# 22 => silver
|
895
|
-
# 23 => gray
|
896
|
-
# 33 => pink
|
897
|
-
# 53 => orange
|
898
|
-
#
|
899
|
-
# A new colour is set using its RGB (red green blue) components. The +red+,
|
900
|
-
# +green+ and +blue+ values must be in the range 0..255. You can determine
|
901
|
-
# the required values in Excel using the Tools->Options->Colors->Modify
|
902
|
-
# dialog.
|
903
|
-
#
|
904
|
-
# The set_custom_color workbook method can also be used with a HTML style
|
905
|
-
# +#rrggbb+ hex value:
|
906
|
-
#
|
907
|
-
# workbook.set_custom_color(40, 255, 102, 0 ) # Orange
|
908
|
-
# workbook.set_custom_color(40, 0xFF, 0x66, 0x00) # Same thing
|
909
|
-
# workbook.set_custom_color(40, '#FF6600' ) # Same thing
|
910
|
-
#
|
911
|
-
# font = workbook.add_format(:color => 40) # Use the modified colour
|
912
|
-
#
|
913
|
-
# The return value from set_custom_color() is the index of the colour that
|
914
|
-
# was changed:
|
915
|
-
#
|
916
|
-
# ferrari = workbook.set_custom_color(40, 216, 12, 12)
|
917
|
-
#
|
918
|
-
# format = workbook.add_format(
|
919
|
-
# :bg_color => ferrari,
|
920
|
-
# :pattern => 1,
|
921
|
-
# :border => 1
|
922
|
-
# )
|
512
|
+
def default_url_format
|
513
|
+
@default_url_format
|
514
|
+
end
|
515
|
+
alias get_default_url_format default_url_format
|
516
|
+
|
923
517
|
#
|
924
|
-
#
|
925
|
-
# unique colors. The WriteXLSX gem will be extended at a later stage to
|
926
|
-
# support the newer, semi-infinite, palette.
|
518
|
+
# Change the RGB components of the elements in the colour palette.
|
927
519
|
#
|
928
520
|
def set_custom_color(index, red = 0, green = 0, blue = 0)
|
929
521
|
# Match a HTML #xxyyzz style parameter
|
@@ -996,14 +588,15 @@ module Writexlsx
|
|
996
588
|
|
997
589
|
def style_properties
|
998
590
|
[
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
591
|
+
@xf_formats,
|
592
|
+
@palette,
|
593
|
+
@font_count,
|
594
|
+
@num_format_count,
|
595
|
+
@border_count,
|
596
|
+
@fill_count,
|
597
|
+
@custom_colors,
|
598
|
+
@dxf_formats,
|
599
|
+
@has_comments
|
1007
600
|
]
|
1008
601
|
end
|
1009
602
|
|
@@ -1031,6 +624,10 @@ module Writexlsx
|
|
1031
624
|
@activesheet ||= 0
|
1032
625
|
end
|
1033
626
|
|
627
|
+
def has_metadata?
|
628
|
+
@has_metadata
|
629
|
+
end
|
630
|
+
|
1034
631
|
private
|
1035
632
|
|
1036
633
|
def filename
|
@@ -1064,63 +661,63 @@ module Writexlsx
|
|
1064
661
|
#
|
1065
662
|
def set_color_palette #:nodoc:
|
1066
663
|
@palette = [
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
664
|
+
[ 0x00, 0x00, 0x00, 0x00 ], # 8
|
665
|
+
[ 0xff, 0xff, 0xff, 0x00 ], # 9
|
666
|
+
[ 0xff, 0x00, 0x00, 0x00 ], # 10
|
667
|
+
[ 0x00, 0xff, 0x00, 0x00 ], # 11
|
668
|
+
[ 0x00, 0x00, 0xff, 0x00 ], # 12
|
669
|
+
[ 0xff, 0xff, 0x00, 0x00 ], # 13
|
670
|
+
[ 0xff, 0x00, 0xff, 0x00 ], # 14
|
671
|
+
[ 0x00, 0xff, 0xff, 0x00 ], # 15
|
672
|
+
[ 0x80, 0x00, 0x00, 0x00 ], # 16
|
673
|
+
[ 0x00, 0x80, 0x00, 0x00 ], # 17
|
674
|
+
[ 0x00, 0x00, 0x80, 0x00 ], # 18
|
675
|
+
[ 0x80, 0x80, 0x00, 0x00 ], # 19
|
676
|
+
[ 0x80, 0x00, 0x80, 0x00 ], # 20
|
677
|
+
[ 0x00, 0x80, 0x80, 0x00 ], # 21
|
678
|
+
[ 0xc0, 0xc0, 0xc0, 0x00 ], # 22
|
679
|
+
[ 0x80, 0x80, 0x80, 0x00 ], # 23
|
680
|
+
[ 0x99, 0x99, 0xff, 0x00 ], # 24
|
681
|
+
[ 0x99, 0x33, 0x66, 0x00 ], # 25
|
682
|
+
[ 0xff, 0xff, 0xcc, 0x00 ], # 26
|
683
|
+
[ 0xcc, 0xff, 0xff, 0x00 ], # 27
|
684
|
+
[ 0x66, 0x00, 0x66, 0x00 ], # 28
|
685
|
+
[ 0xff, 0x80, 0x80, 0x00 ], # 29
|
686
|
+
[ 0x00, 0x66, 0xcc, 0x00 ], # 30
|
687
|
+
[ 0xcc, 0xcc, 0xff, 0x00 ], # 31
|
688
|
+
[ 0x00, 0x00, 0x80, 0x00 ], # 32
|
689
|
+
[ 0xff, 0x00, 0xff, 0x00 ], # 33
|
690
|
+
[ 0xff, 0xff, 0x00, 0x00 ], # 34
|
691
|
+
[ 0x00, 0xff, 0xff, 0x00 ], # 35
|
692
|
+
[ 0x80, 0x00, 0x80, 0x00 ], # 36
|
693
|
+
[ 0x80, 0x00, 0x00, 0x00 ], # 37
|
694
|
+
[ 0x00, 0x80, 0x80, 0x00 ], # 38
|
695
|
+
[ 0x00, 0x00, 0xff, 0x00 ], # 39
|
696
|
+
[ 0x00, 0xcc, 0xff, 0x00 ], # 40
|
697
|
+
[ 0xcc, 0xff, 0xff, 0x00 ], # 41
|
698
|
+
[ 0xcc, 0xff, 0xcc, 0x00 ], # 42
|
699
|
+
[ 0xff, 0xff, 0x99, 0x00 ], # 43
|
700
|
+
[ 0x99, 0xcc, 0xff, 0x00 ], # 44
|
701
|
+
[ 0xff, 0x99, 0xcc, 0x00 ], # 45
|
702
|
+
[ 0xcc, 0x99, 0xff, 0x00 ], # 46
|
703
|
+
[ 0xff, 0xcc, 0x99, 0x00 ], # 47
|
704
|
+
[ 0x33, 0x66, 0xff, 0x00 ], # 48
|
705
|
+
[ 0x33, 0xcc, 0xcc, 0x00 ], # 49
|
706
|
+
[ 0x99, 0xcc, 0x00, 0x00 ], # 50
|
707
|
+
[ 0xff, 0xcc, 0x00, 0x00 ], # 51
|
708
|
+
[ 0xff, 0x99, 0x00, 0x00 ], # 52
|
709
|
+
[ 0xff, 0x66, 0x00, 0x00 ], # 53
|
710
|
+
[ 0x66, 0x66, 0x99, 0x00 ], # 54
|
711
|
+
[ 0x96, 0x96, 0x96, 0x00 ], # 55
|
712
|
+
[ 0x00, 0x33, 0x66, 0x00 ], # 56
|
713
|
+
[ 0x33, 0x99, 0x66, 0x00 ], # 57
|
714
|
+
[ 0x00, 0x33, 0x00, 0x00 ], # 58
|
715
|
+
[ 0x33, 0x33, 0x00, 0x00 ], # 59
|
716
|
+
[ 0x99, 0x33, 0x00, 0x00 ], # 60
|
717
|
+
[ 0x99, 0x33, 0x66, 0x00 ], # 61
|
718
|
+
[ 0x33, 0x33, 0x99, 0x00 ], # 62
|
719
|
+
[ 0x33, 0x33, 0x33, 0x00 ], # 63
|
720
|
+
]
|
1124
721
|
end
|
1125
722
|
|
1126
723
|
#
|
@@ -1184,11 +781,11 @@ module Writexlsx
|
|
1184
781
|
|
1185
782
|
def write_file_version #:nodoc:
|
1186
783
|
attributes = [
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
784
|
+
['appName', 'xl'],
|
785
|
+
['lastEdited', 4],
|
786
|
+
['lowestEdited', 4],
|
787
|
+
['rupBuild', 4505]
|
788
|
+
]
|
1192
789
|
|
1193
790
|
if @vba_project
|
1194
791
|
attributes << [:codeName, '{37E998C4-C9E5-D4B9-71C8-EB1FF731991C}']
|
@@ -1197,6 +794,17 @@ module Writexlsx
|
|
1197
794
|
@writer.empty_tag('fileVersion', attributes)
|
1198
795
|
end
|
1199
796
|
|
797
|
+
#
|
798
|
+
# Write the <fileSharing> element.
|
799
|
+
#
|
800
|
+
def write_file_sharing
|
801
|
+
return if !ptrue?(@read_only)
|
802
|
+
|
803
|
+
attributes = []
|
804
|
+
attributes << ['readOnlyRecommended', 1]
|
805
|
+
@writer.empty_tag('fileSharing', attributes)
|
806
|
+
end
|
807
|
+
|
1200
808
|
def write_workbook_pr #:nodoc:
|
1201
809
|
attributes = []
|
1202
810
|
attributes << ['codeName', @vba_codename] if ptrue?(@vba_codename)
|
@@ -1211,12 +819,12 @@ module Writexlsx
|
|
1211
819
|
|
1212
820
|
def write_workbook_view #:nodoc:
|
1213
821
|
attributes = [
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
if @tab_ratio !=
|
822
|
+
['xWindow', @x_window],
|
823
|
+
['yWindow', @y_window],
|
824
|
+
['windowWidth', @window_width],
|
825
|
+
['windowHeight', @window_height]
|
826
|
+
]
|
827
|
+
if @tab_ratio != 600
|
1220
828
|
attributes << ['tabRatio', @tab_ratio]
|
1221
829
|
end
|
1222
830
|
if @firstsheet > 0
|
@@ -1313,6 +921,9 @@ module Writexlsx
|
|
1313
921
|
# Prepare the worksheet tables.
|
1314
922
|
prepare_tables
|
1315
923
|
|
924
|
+
# Prepare the metadata file links.
|
925
|
+
prepare_metadata
|
926
|
+
|
1316
927
|
# Package the workbook.
|
1317
928
|
packager = Package::Packager.new(self)
|
1318
929
|
packager.set_package_dir(tempdir)
|
@@ -1420,9 +1031,17 @@ module Writexlsx
|
|
1420
1031
|
# string but would evaluate to zero.
|
1421
1032
|
#
|
1422
1033
|
if num_format.to_s =~ /^\d+$/ && num_format.to_s !~ /^0+\d/
|
1034
|
+
# Number format '0' is indexed as 1 in Excel.
|
1035
|
+
if num_format == 0
|
1036
|
+
num_format = 1
|
1037
|
+
end
|
1423
1038
|
# Index to a built-in number format.
|
1424
1039
|
format.num_format_index = num_format
|
1425
1040
|
next
|
1041
|
+
elsif num_format.to_s == 'General'
|
1042
|
+
# The 'General' format has an number format index of 0.
|
1043
|
+
format.num_format_index = 0
|
1044
|
+
next
|
1426
1045
|
end
|
1427
1046
|
|
1428
1047
|
if num_formats[num_format]
|
@@ -1540,20 +1159,20 @@ module Writexlsx
|
|
1540
1159
|
# Check for Print Area settings.
|
1541
1160
|
if sheet.autofilter_area
|
1542
1161
|
@defined_names << [
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1162
|
+
'_xlnm._FilterDatabase',
|
1163
|
+
sheet.index,
|
1164
|
+
sheet.autofilter_area,
|
1165
|
+
1
|
1166
|
+
]
|
1548
1167
|
end
|
1549
1168
|
|
1550
1169
|
# Check for Print Area settings.
|
1551
1170
|
if !sheet.print_area.empty?
|
1552
1171
|
@defined_names << [
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1172
|
+
'_xlnm.Print_Area',
|
1173
|
+
sheet.index,
|
1174
|
+
sheet.print_area
|
1175
|
+
]
|
1557
1176
|
end
|
1558
1177
|
|
1559
1178
|
# Check for repeat rows/cols. aka, Print Titles.
|
@@ -1591,11 +1210,14 @@ module Writexlsx
|
|
1591
1210
|
if sheet.has_comments?
|
1592
1211
|
comment_files += 1
|
1593
1212
|
comment_id += 1
|
1213
|
+
@has_comments = true
|
1594
1214
|
end
|
1595
1215
|
vml_drawing_id += 1
|
1596
1216
|
|
1597
|
-
sheet.prepare_vml_objects(
|
1598
|
-
|
1217
|
+
sheet.prepare_vml_objects(
|
1218
|
+
vml_data_id, vml_shape_id,
|
1219
|
+
vml_drawing_id, comment_id
|
1220
|
+
)
|
1599
1221
|
|
1600
1222
|
# Each VML file should start with a shape id incremented by 1024.
|
1601
1223
|
vml_data_id += 1 * ( 1 + sheet.num_comments_block )
|
@@ -1618,8 +1240,6 @@ module Writexlsx
|
|
1618
1240
|
end
|
1619
1241
|
end
|
1620
1242
|
|
1621
|
-
add_font_format_for_cell_comments if num_comment_files > 0
|
1622
|
-
|
1623
1243
|
# Set the workbook vba_codename if one of the sheets has a button and
|
1624
1244
|
# the workbook has a vbaProject binary.
|
1625
1245
|
if has_button && @vba_project && !@vba_codename
|
@@ -1632,23 +1252,23 @@ module Writexlsx
|
|
1632
1252
|
#
|
1633
1253
|
def prepare_tables
|
1634
1254
|
table_id = 0
|
1255
|
+
seen = {}
|
1635
1256
|
|
1636
1257
|
sheets.each do |sheet|
|
1637
|
-
table_id += sheet.prepare_tables(table_id + 1)
|
1258
|
+
table_id += sheet.prepare_tables(table_id + 1, seen)
|
1638
1259
|
end
|
1639
1260
|
end
|
1640
1261
|
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
@formats.formats << format
|
1262
|
+
#
|
1263
|
+
# Set the metadata rel link.
|
1264
|
+
#
|
1265
|
+
def prepare_metadata
|
1266
|
+
@worksheets.each do |sheet|
|
1267
|
+
if sheet.has_dynamic_arrays?
|
1268
|
+
@has_metadata = true
|
1269
|
+
break
|
1270
|
+
end
|
1271
|
+
end
|
1652
1272
|
end
|
1653
1273
|
|
1654
1274
|
#
|
@@ -1801,37 +1421,69 @@ module Writexlsx
|
|
1801
1421
|
# Iterate through the worksheets and set up any chart or image drawings.
|
1802
1422
|
#
|
1803
1423
|
def prepare_drawings #:nodoc:
|
1804
|
-
chart_ref_id
|
1805
|
-
image_ref_id
|
1806
|
-
drawing_id
|
1424
|
+
chart_ref_id = 0
|
1425
|
+
image_ref_id = 0
|
1426
|
+
drawing_id = 0
|
1427
|
+
ref_id = 0
|
1428
|
+
image_ids = {}
|
1429
|
+
header_image_ids = {}
|
1430
|
+
background_ids = {}
|
1807
1431
|
@worksheets.each do |sheet|
|
1808
1432
|
chart_count = sheet.charts.size
|
1809
1433
|
image_count = sheet.images.size
|
1810
1434
|
shape_count = sheet.shapes.size
|
1811
1435
|
header_image_count = sheet.header_images.size
|
1812
1436
|
footer_image_count = sheet.footer_images.size
|
1813
|
-
|
1437
|
+
has_background = sheet.background_image.size
|
1438
|
+
has_drawings = false
|
1814
1439
|
|
1815
1440
|
# Check that some image or drawing needs to be processed.
|
1816
|
-
next if chart_count + image_count + shape_count + header_image_count + footer_image_count == 0
|
1441
|
+
next if chart_count + image_count + shape_count + header_image_count + footer_image_count + has_background == 0
|
1817
1442
|
|
1818
1443
|
# Don't increase the drawing_id header/footer images.
|
1819
1444
|
if chart_count + image_count + shape_count > 0
|
1820
1445
|
drawing_id += 1
|
1821
|
-
|
1446
|
+
has_drawings = true
|
1822
1447
|
end
|
1823
1448
|
|
1824
|
-
# Prepare the
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1449
|
+
# Prepare the background images.
|
1450
|
+
if ptrue?(has_background)
|
1451
|
+
filename = sheet.background_image
|
1452
|
+
type, width, height, name, x_dpi, y_dpi, md5 = get_image_properties(filename)
|
1453
|
+
|
1454
|
+
if background_ids[md5]
|
1455
|
+
ref_id = background_ids[md5]
|
1456
|
+
else
|
1457
|
+
image_ref_id += 1
|
1458
|
+
ref_id = image_ref_id
|
1459
|
+
background_ids[md5] = ref_id
|
1460
|
+
@images << [filename, type]
|
1461
|
+
end
|
1462
|
+
|
1463
|
+
sheet.prepare_background(ref_id, type)
|
1828
1464
|
end
|
1829
1465
|
|
1830
1466
|
# Prepare the worksheet images.
|
1831
1467
|
sheet.images.each_with_index do |image, index|
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1468
|
+
filename = image[2]
|
1469
|
+
type, width, height, name, x_dpi, y_dpi, md5 = get_image_properties(image[2])
|
1470
|
+
if image_ids[md5]
|
1471
|
+
ref_id = image_ids[md5]
|
1472
|
+
else
|
1473
|
+
image_ref_id += 1
|
1474
|
+
image_ids[md5] = ref_id = image_ref_id
|
1475
|
+
@images << [filename, type]
|
1476
|
+
end
|
1477
|
+
sheet.prepare_image(
|
1478
|
+
index, ref_id, drawing_id, width, height,
|
1479
|
+
name, type, x_dpi, y_dpi, md5
|
1480
|
+
)
|
1481
|
+
end
|
1482
|
+
|
1483
|
+
# Prepare the worksheet charts.
|
1484
|
+
sheet.charts.each_with_index do |chart, index|
|
1485
|
+
chart_ref_id += 1
|
1486
|
+
sheet.prepare_chart(index, chart_ref_id, drawing_id)
|
1835
1487
|
end
|
1836
1488
|
|
1837
1489
|
# Prepare the worksheet shapes.
|
@@ -1844,13 +1496,21 @@ module Writexlsx
|
|
1844
1496
|
filename = sheet.header_images[index][0]
|
1845
1497
|
position = sheet.header_images[index][1]
|
1846
1498
|
|
1847
|
-
type, width, height, name, x_dpi, y_dpi =
|
1499
|
+
type, width, height, name, x_dpi, y_dpi, md5 =
|
1848
1500
|
get_image_properties(filename)
|
1849
1501
|
|
1850
|
-
|
1502
|
+
if header_image_ids[md5]
|
1503
|
+
ref_id = header_image_ids[md5]
|
1504
|
+
else
|
1505
|
+
image_ref_id += 1
|
1506
|
+
header_image_ids[md5] = ref_id = image_ref_id
|
1507
|
+
@images << [filename, type]
|
1508
|
+
end
|
1851
1509
|
|
1852
|
-
sheet.prepare_header_image(
|
1853
|
-
|
1510
|
+
sheet.prepare_header_image(
|
1511
|
+
ref_id, width, height, name, type,
|
1512
|
+
position, x_dpi, y_dpi, md5
|
1513
|
+
)
|
1854
1514
|
end
|
1855
1515
|
|
1856
1516
|
# Prepare the footer images.
|
@@ -1858,18 +1518,26 @@ module Writexlsx
|
|
1858
1518
|
filename = sheet.footer_images[index][0]
|
1859
1519
|
position = sheet.footer_images[index][1]
|
1860
1520
|
|
1861
|
-
type, width, height, name, x_dpi, y_dpi =
|
1521
|
+
type, width, height, name, x_dpi, y_dpi, md5 =
|
1862
1522
|
get_image_properties(filename)
|
1863
1523
|
|
1864
|
-
|
1524
|
+
if header_image_ids[md5]
|
1525
|
+
ref_id = header_image_ids[md5]
|
1526
|
+
else
|
1527
|
+
image_ref_id += 1
|
1528
|
+
header_image_ids[md5] = ref_id = image_ref_id
|
1529
|
+
@images << [filename, type]
|
1530
|
+
end
|
1865
1531
|
|
1866
|
-
sheet.prepare_header_image(
|
1867
|
-
|
1532
|
+
sheet.prepare_header_image(
|
1533
|
+
ref_id, width, height, name, type,
|
1534
|
+
position, x_dpi, y_dpi, md5
|
1535
|
+
)
|
1868
1536
|
end
|
1869
1537
|
|
1870
|
-
if
|
1871
|
-
|
1872
|
-
@drawings <<
|
1538
|
+
if has_drawings
|
1539
|
+
drawings = sheet.drawings
|
1540
|
+
@drawings << drawings
|
1873
1541
|
end
|
1874
1542
|
end
|
1875
1543
|
|
@@ -1893,6 +1561,7 @@ module Writexlsx
|
|
1893
1561
|
|
1894
1562
|
# Open the image file and import the data.
|
1895
1563
|
data = File.binread(filename)
|
1564
|
+
md5 = Digest::MD5.hexdigest(data)
|
1896
1565
|
if data.unpack('x A3')[0] == 'PNG'
|
1897
1566
|
# Test for PNGs.
|
1898
1567
|
type, width, height, x_dpi, y_dpi = process_png(data)
|
@@ -1901,6 +1570,10 @@ module Writexlsx
|
|
1901
1570
|
# Test for JPEG files.
|
1902
1571
|
type, width, height, x_dpi, y_dpi = process_jpg(data, filename)
|
1903
1572
|
@image_types[:jpeg] = 1
|
1573
|
+
elsif data.unpack('A4')[0] == 'GIF8'
|
1574
|
+
# Test for GIFs.
|
1575
|
+
type, width, height, x_dpi, y_dpi = process_gif(data, filename)
|
1576
|
+
@image_types[:gif] = 1
|
1904
1577
|
elsif data.unpack('A2')[0] == 'BM'
|
1905
1578
|
# Test for BMPs.
|
1906
1579
|
type, width, height = process_bmp(data, filename)
|
@@ -1910,9 +1583,11 @@ module Writexlsx
|
|
1910
1583
|
raise "Unsupported image format for file: #{filename}\n"
|
1911
1584
|
end
|
1912
1585
|
|
1913
|
-
|
1586
|
+
# Set a default dpi for images with 0 dpi.
|
1587
|
+
x_dpi = 96 if x_dpi == 0
|
1588
|
+
y_dpi = 96 if y_dpi == 0
|
1914
1589
|
|
1915
|
-
[type, width, height, File.basename(filename), x_dpi, y_dpi]
|
1590
|
+
[type, width, height, File.basename(filename), x_dpi, y_dpi, md5]
|
1916
1591
|
end
|
1917
1592
|
|
1918
1593
|
#
|
@@ -1967,16 +1642,20 @@ module Writexlsx
|
|
1967
1642
|
offset = 2
|
1968
1643
|
data_length = data.bytesize
|
1969
1644
|
|
1970
|
-
# Search through the image data to read the
|
1971
|
-
# 0xFFC0/C2 element. Also read the DPI in the 0xFFE0 element.
|
1645
|
+
# Search through the image data to read the JPEG markers.
|
1972
1646
|
while offset < data_length
|
1973
1647
|
marker = data[offset+0, 2].unpack("n")[0]
|
1974
1648
|
length = data[offset+2, 2].unpack("n")[0]
|
1975
1649
|
|
1976
|
-
|
1650
|
+
# Read the height and width in the 0xFFCn elements
|
1651
|
+
# (Except C4, C8 and CC which aren't SOF markers).
|
1652
|
+
if (marker & 0xFFF0) == 0xFFC0 &&
|
1653
|
+
marker != 0xFFC4 && marker != 0xFFCC
|
1977
1654
|
height = data[offset+5, 2].unpack("n")[0]
|
1978
1655
|
width = data[offset+7, 2].unpack("n")[0]
|
1979
1656
|
end
|
1657
|
+
|
1658
|
+
# Read the DPI in the 0xFFE0 element.
|
1980
1659
|
if marker == 0xFFE0
|
1981
1660
|
units = data[offset + 11, 1].unpack("C")[0]
|
1982
1661
|
x_density = data[offset + 12, 2].unpack("n")[0]
|
@@ -1999,6 +1678,24 @@ module Writexlsx
|
|
1999
1678
|
[type, width, height, x_dpi, y_dpi]
|
2000
1679
|
end
|
2001
1680
|
|
1681
|
+
#
|
1682
|
+
# Extract width and height information from a GIF file.
|
1683
|
+
#
|
1684
|
+
def process_gif(data, filename)
|
1685
|
+
type = 'gif'
|
1686
|
+
x_dpi = 96
|
1687
|
+
y_dpi = 96
|
1688
|
+
|
1689
|
+
width = data[6, 2].unpack("v")[0]
|
1690
|
+
height = data[8, 2].unpack("v")[0]
|
1691
|
+
|
1692
|
+
if height.nil?
|
1693
|
+
raise "#{filename}: no size data found in gif image.\n"
|
1694
|
+
end
|
1695
|
+
|
1696
|
+
[type, width, height, x_dpi, y_dpi]
|
1697
|
+
end
|
1698
|
+
|
2002
1699
|
# Extract width and height information from a BMP file.
|
2003
1700
|
def process_bmp(data, filename) #:nodoc:
|
2004
1701
|
type = 'bmp'
|