diff -Nru libexcel-writer-xlsx-perl-1.10/Changes libexcel-writer-xlsx-perl-1.11/Changes --- libexcel-writer-xlsx-perl-1.10/Changes 2022-12-30 20:07:42.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/Changes 2023-03-19 12:20:50.000000000 +0000 @@ -5,10 +5,30 @@ ! Bug fix. +1.11 2023-03-19 + + + Added support for simulated worksheet `autofit()`. + + + Refactored internal column property handling to allow column ranges + to be overridden (a common UX expectation). + + + Add `quote_prefix` format property. + + ! Add fix for forward/backward slash issue on Windows perl builds. + Possibly introduced by a change in File::Find. Issue #284 + + ! Fix for duplicate number formats. Issue #283 + + ! Add fix for worksheets with tables and background images. + + ! Replace/fix the worksheet protection password algorithm + so that is works correctly for strings over 24 chars. + + 1.10 2022-12-30 + Add support for new Excel 365 dynamic functions. - + 1.09 2021-05-14 diff -Nru libexcel-writer-xlsx-perl-1.10/debian/changelog libexcel-writer-xlsx-perl-1.11/debian/changelog --- libexcel-writer-xlsx-perl-1.10/debian/changelog 2023-01-25 11:06:44.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/debian/changelog 2023-04-12 08:09:43.000000000 +0000 @@ -1,3 +1,12 @@ +libexcel-writer-xlsx-perl (1.11-1) unstable; urgency=medium + + * New upstream release. + * repacked orig tarball b/c it contains unrecognised extension tags ala + 'LIBARCHIVE.xattr.com.apple.lastuseddate#PS' + * lifted standards version + + -- Alexander Zangerl Wed, 12 Apr 2023 18:09:43 +1000 + libexcel-writer-xlsx-perl (1.10-1) unstable; urgency=high * New upstream release diff -Nru libexcel-writer-xlsx-perl-1.10/debian/control libexcel-writer-xlsx-perl-1.11/debian/control --- libexcel-writer-xlsx-perl-1.10/debian/control 2020-08-26 09:19:58.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/debian/control 2023-04-12 08:09:43.000000000 +0000 @@ -4,7 +4,7 @@ Maintainer: Alexander Zangerl Build-Depends: debhelper (>= 10.0.0) Build-Depends-Indep: perl, libarchive-zip-perl -Standards-Version: 4.3.0 +Standards-Version: 4.6.2 Package: libexcel-writer-xlsx-perl Architecture: all diff -Nru libexcel-writer-xlsx-perl-1.10/debian/libexcel-writer-xlsx-perl.lintian-overrides libexcel-writer-xlsx-perl-1.11/debian/libexcel-writer-xlsx-perl.lintian-overrides --- libexcel-writer-xlsx-perl-1.10/debian/libexcel-writer-xlsx-perl.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/debian/libexcel-writer-xlsx-perl.lintian-overrides 2023-04-12 08:09:43.000000000 +0000 @@ -0,0 +1,2 @@ +national-encoding * + diff -Nru libexcel-writer-xlsx-perl-1.10/debian/rules libexcel-writer-xlsx-perl-1.11/debian/rules --- libexcel-writer-xlsx-perl-1.10/debian/rules 2020-08-26 09:19:32.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/debian/rules 2023-04-12 08:09:43.000000000 +0000 @@ -35,6 +35,7 @@ $(MAKE) test endif $(MAKE) install DESTDIR=$(CURDIR)/debian/libexcel-writer-xlsx-perl/ + dh_lintian dh_install dh_installdocs -n dh_installchangelogs diff -Nru libexcel-writer-xlsx-perl-1.10/examples/autofit.pl libexcel-writer-xlsx-perl-1.11/examples/autofit.pl --- libexcel-writer-xlsx-perl-1.10/examples/autofit.pl 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/examples/autofit.pl 2023-01-04 14:39:56.000000000 +0000 @@ -0,0 +1,37 @@ +#!/usr/bin/perl -w + +####################################################################### +# +# An example of using simulated autofit to automatically adjust the width of +# worksheet columns based on the data in the cells. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use strict; +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( 'autofit.xlsx' ); +my $worksheet = $workbook->add_worksheet(); + +# Write some worksheet data to demonstrate autofitting. +$worksheet->write( 0, 0, "Foo" ); +$worksheet->write( 1, 0, "Food" ); +$worksheet->write( 2, 0, "Foody" ); +$worksheet->write( 3, 0, "Froody" ); + +$worksheet->write( 0, 1, 12345 ); +$worksheet->write( 1, 1, 12345678 ); +$worksheet->write( 2, 1, 12345 ); + +$worksheet->write( 0, 2, "Some longer text" ); + +$worksheet->write( 0, 3, "http://ww.google.com" ); +$worksheet->write( 1, 3, "https://github.com" ); + +# Autofit the worksheet. +$worksheet->autofit(); + +$workbook->close(); + +__END__ diff -Nru libexcel-writer-xlsx-perl-1.10/examples/chart_radar.pl libexcel-writer-xlsx-perl-1.11/examples/chart_radar.pl --- libexcel-writer-xlsx-perl-1.10/examples/chart_radar.pl 2022-12-30 20:12:06.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/examples/chart_radar.pl 2023-02-19 14:19:08.000000000 +0000 @@ -45,10 +45,8 @@ values => [ 'Sheet1', 1, 6, 2, 2 ], ); -# Add a chart title and some axis labels. +# Add a chart title. $chart1->set_title ( name => 'Results of sample analysis' ); -$chart1->set_x_axis( name => 'Test number' ); -$chart1->set_y_axis( name => 'Sample length (mm)' ); # Set an Excel chart style. Blue colors with white outline and shadow. $chart1->set_style( 11 ); @@ -80,10 +78,8 @@ values => [ 'Sheet1', 1, 6, 2, 2 ], ); -# Add a chart title and some axis labels. +# Add a chart title. $chart2->set_title ( name => 'Stacked Chart' ); -$chart2->set_x_axis( name => 'Test number' ); -$chart2->set_y_axis( name => 'Sample length (mm)' ); # Set an Excel chart style. Blue colors with white outline and shadow. $chart2->set_style( 12 ); @@ -115,10 +111,8 @@ values => [ 'Sheet1', 1, 6, 2, 2 ], ); -# Add a chart title and some axis labels. +# Add a chart title. $chart3->set_title ( name => 'Percent Stacked Chart' ); -$chart3->set_x_axis( name => 'Test number' ); -$chart3->set_y_axis( name => 'Sample length (mm)' ); # Set an Excel chart style. Blue colors with white outline and shadow. $chart3->set_style( 13 ); diff -Nru libexcel-writer-xlsx-perl-1.10/examples/README libexcel-writer-xlsx-perl-1.11/examples/README --- libexcel-writer-xlsx-perl-1.10/examples/README 2022-12-30 21:00:27.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/examples/README 2023-03-19 12:22:03.000000000 +0000 @@ -15,6 +15,7 @@ Intermediate ============ +autofit.pl Examples of simulated worksheet autofit. autofilter.pl Examples of worksheet autofilters. array_formula.pl Examples of how to write array formulas. cgi.pl A simple CGI program. diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Area.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Area.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Area.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Area.pm 2023-03-19 12:12:09.000000000 +0000 @@ -22,7 +22,7 @@ use Excel::Writer::XLSX::Chart; our @ISA = qw(Excel::Writer::XLSX::Chart); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Bar.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Bar.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Bar.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Bar.pm 2023-03-19 12:12:09.000000000 +0000 @@ -22,7 +22,7 @@ use Excel::Writer::XLSX::Chart; our @ISA = qw(Excel::Writer::XLSX::Chart); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Column.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Column.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Column.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Column.pm 2023-03-19 12:12:09.000000000 +0000 @@ -22,7 +22,7 @@ use Excel::Writer::XLSX::Chart; our @ISA = qw(Excel::Writer::XLSX::Chart); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Doughnut.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Doughnut.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Doughnut.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Doughnut.pm 2023-03-19 12:12:09.000000000 +0000 @@ -22,7 +22,7 @@ use Excel::Writer::XLSX::Chart::Pie; our @ISA = qw(Excel::Writer::XLSX::Chart::Pie); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Line.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Line.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Line.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Line.pm 2023-03-19 12:12:09.000000000 +0000 @@ -22,7 +22,7 @@ use Excel::Writer::XLSX::Chart; our @ISA = qw(Excel::Writer::XLSX::Chart); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Pie.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Pie.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Pie.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Pie.pm 2023-03-19 12:12:09.000000000 +0000 @@ -22,7 +22,7 @@ use Excel::Writer::XLSX::Chart; our @ISA = qw(Excel::Writer::XLSX::Chart); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Radar.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Radar.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Radar.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Radar.pm 2023-03-19 12:12:09.000000000 +0000 @@ -22,7 +22,7 @@ use Excel::Writer::XLSX::Chart; our @ISA = qw(Excel::Writer::XLSX::Chart); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Scatter.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Scatter.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Scatter.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Scatter.pm 2023-03-19 12:12:09.000000000 +0000 @@ -22,7 +22,7 @@ use Excel::Writer::XLSX::Chart; our @ISA = qw(Excel::Writer::XLSX::Chart); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Stock.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Stock.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart/Stock.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart/Stock.pm 2023-03-19 12:12:09.000000000 +0000 @@ -22,7 +22,7 @@ use Excel::Writer::XLSX::Chart; our @ISA = qw(Excel::Writer::XLSX::Chart); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chart.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chart.pm 2023-03-19 12:12:09.000000000 +0000 @@ -27,7 +27,7 @@ quote_sheetname ); our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### @@ -470,7 +470,7 @@ my $self = shift; my $style_id = defined $_[0] ? $_[0] : 2; - if ( $style_id < 0 || $style_id > 48 ) { + if ( $style_id < 1 || $style_id > 48 ) { $style_id = 2; } diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chartsheet.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chartsheet.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Chartsheet.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Chartsheet.pm 2023-03-19 12:12:09.000000000 +0000 @@ -20,7 +20,7 @@ use Excel::Writer::XLSX::Worksheet; our @ISA = qw(Excel::Writer::XLSX::Worksheet); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Drawing.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Drawing.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Drawing.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Drawing.pm 2023-03-19 12:12:09.000000000 +0000 @@ -21,7 +21,7 @@ use Excel::Writer::XLSX::Worksheet; our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Examples.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Examples.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Examples.pm 2022-12-30 21:00:49.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Examples.pm 2023-03-19 12:24:22.000000000 +0000 @@ -17,7 +17,7 @@ use strict; use warnings; -our $VERSION = '1.10'; +our $VERSION = '1.11'; 1; @@ -41,7 +41,7 @@ =head1 Example programs -The following is a list of the 94 example programs that are included in the Excel::Writer::XLSX distribution. +The following is a list of the 95 example programs that are included in the Excel::Writer::XLSX distribution. =over @@ -57,6 +57,8 @@ =item * L Basic formulas and functions. +=item * L Examples of simulated worksheet autofit. + =item * L Examples of worksheet autofilters. =item * L Examples of how to write array formulas. @@ -297,7 +299,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: bug_report.pl @@ -449,7 +451,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: demo.pl @@ -587,7 +589,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: formats.pl @@ -1128,7 +1130,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: regions.pl @@ -1199,7 +1201,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: stats.pl @@ -1292,7 +1294,65 @@ __END__ -Download this example: L +Download this example: L + +=head2 Example: autofit.pl + + + +An example of using simulated autofit to automatically adjust the width of +worksheet columns based on the data in the cells. + + + +=begin html + +

Output from autofit.pl

+ +=end html + +Source code for this example: + + #!/usr/bin/perl -w + + ####################################################################### + # + # An example of using simulated autofit to automatically adjust the width of + # worksheet columns based on the data in the cells. + # + # Copyright 2000-2023, John McNamara, jmcnamara@cpan.org + # + + use strict; + use Excel::Writer::XLSX; + + my $workbook = Excel::Writer::XLSX->new( 'autofit.xlsx' ); + my $worksheet = $workbook->add_worksheet(); + + # Write some worksheet data to demonstrate autofitting. + $worksheet->write( 0, 0, "Foo" ); + $worksheet->write( 1, 0, "Food" ); + $worksheet->write( 2, 0, "Foody" ); + $worksheet->write( 3, 0, "Froody" ); + + $worksheet->write( 0, 1, 12345 ); + $worksheet->write( 1, 1, 12345678 ); + $worksheet->write( 2, 1, 12345 ); + + $worksheet->write( 0, 2, "Some longer text" ); + + $worksheet->write( 0, 3, "http://ww.google.com" ); + $worksheet->write( 1, 3, "https://github.com" ); + + # Autofit the worksheet. + $worksheet->autofit(); + + $workbook->close(); + + __END__ + + +Download this example: L =head2 Example: autofilter.pl @@ -1626,7 +1686,7 @@ East Grape 6000 February -Download this example: L +Download this example: L =head2 Example: array_formula.pl @@ -1683,7 +1743,7 @@ -Download this example: L +Download this example: L =head2 Example: cgi.pl @@ -1760,7 +1820,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_area.pl @@ -1911,7 +1971,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_bar.pl @@ -2062,7 +2122,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_column.pl @@ -2213,7 +2273,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_line.pl @@ -2364,7 +2424,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_pie.pl @@ -2498,7 +2558,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_doughnut.pl @@ -2656,7 +2716,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_radar.pl @@ -2721,10 +2781,8 @@ values => [ 'Sheet1', 1, 6, 2, 2 ], ); - # Add a chart title and some axis labels. + # Add a chart title. $chart1->set_title ( name => 'Results of sample analysis' ); - $chart1->set_x_axis( name => 'Test number' ); - $chart1->set_y_axis( name => 'Sample length (mm)' ); # Set an Excel chart style. Blue colors with white outline and shadow. $chart1->set_style( 11 ); @@ -2756,10 +2814,8 @@ values => [ 'Sheet1', 1, 6, 2, 2 ], ); - # Add a chart title and some axis labels. + # Add a chart title. $chart2->set_title ( name => 'Stacked Chart' ); - $chart2->set_x_axis( name => 'Test number' ); - $chart2->set_y_axis( name => 'Sample length (mm)' ); # Set an Excel chart style. Blue colors with white outline and shadow. $chart2->set_style( 12 ); @@ -2791,10 +2847,8 @@ values => [ 'Sheet1', 1, 6, 2, 2 ], ); - # Add a chart title and some axis labels. + # Add a chart title. $chart3->set_title ( name => 'Percent Stacked Chart' ); - $chart3->set_x_axis( name => 'Test number' ); - $chart3->set_y_axis( name => 'Sample length (mm)' ); # Set an Excel chart style. Blue colors with white outline and shadow. $chart3->set_style( 13 ); @@ -2807,7 +2861,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_scatter.pl @@ -3035,7 +3089,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_secondary_axis.pl @@ -3113,7 +3167,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_combined.pl @@ -3238,7 +3292,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_pareto.pl @@ -3337,7 +3391,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_stock.pl @@ -3428,7 +3482,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_data_table.pl @@ -3545,7 +3599,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_data_tools.pl @@ -3784,7 +3838,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_data_labels.pl @@ -4117,7 +4171,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_clustered.pl @@ -4195,7 +4249,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_styles.pl @@ -4266,7 +4320,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: chart_gauge.pl @@ -4357,7 +4411,7 @@ $workbook->close(); -Download this example: L +Download this example: L =head2 Example: colors.pl @@ -4540,7 +4594,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: comments1.pl @@ -4593,7 +4647,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: comments2.pl @@ -4967,7 +5021,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: conditional_format.pl @@ -5433,7 +5487,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: data_validate.pl @@ -5771,7 +5825,7 @@ -Download this example: L +Download this example: L =head2 Example: date_time.pl @@ -5885,7 +5939,7 @@ -Download this example: L +Download this example: L =head2 Example: defined_name.pl @@ -5948,7 +6002,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: diag_border.pl @@ -6009,7 +6063,7 @@ -Download this example: L +Download this example: L =head2 Example: dynamic_arrays.pl @@ -6293,7 +6347,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: filehandle.pl @@ -6422,7 +6476,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: headers.pl @@ -6613,7 +6667,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: hide_row_col.pl @@ -6675,7 +6729,7 @@ -Download this example: L +Download this example: L =head2 Example: hide_sheet.pl @@ -6727,7 +6781,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: hyperlink1.pl @@ -6803,7 +6857,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: hyperlink2.pl @@ -6966,7 +7020,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: indent.pl @@ -7018,7 +7072,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: ignore_errors.pl @@ -7068,7 +7122,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: lambda.pl @@ -7121,7 +7175,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: macros.pl @@ -7192,7 +7246,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: merge1.pl @@ -7257,7 +7311,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: merge2.pl @@ -7331,7 +7385,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: merge3.pl @@ -7399,7 +7453,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: merge4.pl @@ -7511,7 +7565,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: merge5.pl @@ -7611,7 +7665,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: merge6.pl @@ -7687,7 +7741,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: mod_perl1.pl @@ -7812,7 +7866,7 @@ 1; -Download this example: L +Download this example: L =head2 Example: mod_perl2.pl @@ -7940,7 +7994,7 @@ 1; -Download this example: L +Download this example: L =head2 Example: outline.pl @@ -8269,7 +8323,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: outline_collapsed.pl @@ -8506,7 +8560,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: panes.pl @@ -8662,7 +8716,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: properties.pl @@ -8718,7 +8772,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: protection.pl @@ -8784,7 +8838,7 @@ -Download this example: L +Download this example: L =head2 Example: rich_strings.pl @@ -8849,7 +8903,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: right_to_left.pl @@ -8898,7 +8952,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: sales.pl @@ -9022,7 +9076,7 @@ -Download this example: L +Download this example: L =head2 Example: shape1.pl @@ -9077,7 +9131,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: shape2.pl @@ -9152,7 +9206,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: shape3.pl @@ -9206,7 +9260,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: shape4.pl @@ -9284,7 +9338,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: shape5.pl @@ -9346,7 +9400,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: shape6.pl @@ -9408,7 +9462,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: shape7.pl @@ -9499,7 +9553,7 @@ -Download this example: L +Download this example: L =head2 Example: shape8.pl @@ -9589,7 +9643,7 @@ -Download this example: L +Download this example: L =head2 Example: shape_all.pl @@ -9854,7 +9908,7 @@ Tabs squareTabs -Download this example: L +Download this example: L =head2 Example: sparklines1.pl @@ -9943,7 +9997,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: sparklines2.pl @@ -10371,7 +10425,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: stats_ext.pl @@ -10474,7 +10528,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: stocks.pl @@ -10576,7 +10630,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: watermark.pl @@ -10615,7 +10669,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: background.pl @@ -10647,7 +10701,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: tab_colors.pl @@ -10696,7 +10750,7 @@ __END__ -Download this example: L +Download this example: L =head2 Example: tables.pl @@ -11125,7 +11179,7 @@ -Download this example: L +Download this example: L =head2 Example: write_handler1.pl @@ -11214,7 +11268,7 @@ -Download this example: L +Download this example: L =head2 Example: write_handler2.pl @@ -11312,7 +11366,7 @@ -Download this example: L +Download this example: L =head2 Example: write_handler3.pl @@ -11402,7 +11456,7 @@ -Download this example: L +Download this example: L =head2 Example: write_handler4.pl @@ -11532,7 +11586,7 @@ -Download this example: L +Download this example: L =head2 Example: write_to_scalar.pl @@ -11581,7 +11635,7 @@ -Download this example: L +Download this example: L =head2 Example: unicode_2022_jp.pl @@ -11647,7 +11701,7 @@ -Download this example: L +Download this example: L =head2 Example: unicode_8859_11.pl @@ -11713,7 +11767,7 @@ -Download this example: L +Download this example: L =head2 Example: unicode_8859_7.pl @@ -11779,7 +11833,7 @@ -Download this example: L +Download this example: L =head2 Example: unicode_big5.pl @@ -11845,7 +11899,7 @@ -Download this example: L +Download this example: L =head2 Example: unicode_cp1251.pl @@ -11911,7 +11965,7 @@ -Download this example: L +Download this example: L =head2 Example: unicode_cp1256.pl @@ -11977,7 +12031,7 @@ -Download this example: L +Download this example: L =head2 Example: unicode_cyrillic.pl @@ -12048,7 +12102,7 @@ -Download this example: L +Download this example: L =head2 Example: unicode_koi8r.pl @@ -12114,7 +12168,7 @@ -Download this example: L +Download this example: L =head2 Example: unicode_polish_utf8.pl @@ -12180,7 +12234,7 @@ -Download this example: L +Download this example: L =head2 Example: unicode_shift_jis.pl @@ -12246,7 +12300,7 @@ -Download this example: L +Download this example: L =head1 AUTHOR diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Format.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Format.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Format.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Format.pm 2023-03-19 12:12:09.000000000 +0000 @@ -20,7 +20,7 @@ our @ISA = qw(Exporter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; our $AUTOLOAD; @@ -106,6 +106,8 @@ _color_indexed => 0, _font_only => 0, + _quote_prefix => 0, + }; bless $self, $class; @@ -261,7 +263,8 @@ $self->get_font_key(), $self->get_border_key, $self->get_fill_key(), $self->get_alignment_key(), $self->{_num_format}, $self->{_locked}, - $self->{_hidden} + $self->{_hidden}, + $self->{_quote_prefix}, ); return $key; diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/App.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/App.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/App.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/App.pm 2023-03-19 12:12:09.000000000 +0000 @@ -20,7 +20,7 @@ use Excel::Writer::XLSX::Package::XMLwriter; our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Comments.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Comments.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Comments.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Comments.pm 2023-03-19 12:12:09.000000000 +0000 @@ -22,7 +22,7 @@ our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/ContentTypes.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/ContentTypes.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/ContentTypes.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/ContentTypes.pm 2023-03-19 12:12:09.000000000 +0000 @@ -21,7 +21,7 @@ use Excel::Writer::XLSX::Package::XMLwriter; our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Core.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Core.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Core.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Core.pm 2023-03-19 12:12:09.000000000 +0000 @@ -20,7 +20,7 @@ use Excel::Writer::XLSX::Package::XMLwriter; our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Custom.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Custom.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Custom.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Custom.pm 2023-03-19 12:12:09.000000000 +0000 @@ -21,7 +21,7 @@ use Excel::Writer::XLSX::Package::XMLwriter; our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Metadata.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Metadata.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Metadata.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Metadata.pm 2023-03-19 12:12:09.000000000 +0000 @@ -20,7 +20,7 @@ use Excel::Writer::XLSX::Package::XMLwriter; our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Packager.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Packager.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Packager.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Packager.pm 2023-03-19 12:12:09.000000000 +0000 @@ -33,7 +33,7 @@ use Excel::Writer::XLSX::Package::VML; our @ISA = qw(Exporter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### @@ -578,7 +578,7 @@ my $xf_formats = $self->{_workbook}->{_xf_formats}; my $palette = $self->{_workbook}->{_palette}; my $font_count = $self->{_workbook}->{_font_count}; - my $num_format_count = $self->{_workbook}->{_num_format_count}; + my $num_formats = $self->{_workbook}->{_num_formats}; my $border_count = $self->{_workbook}->{_border_count}; my $fill_count = $self->{_workbook}->{_fill_count}; my $custom_colors = $self->{_workbook}->{_custom_colors}; @@ -593,7 +593,7 @@ $xf_formats, $palette, $font_count, - $num_format_count, + $num_formats, $border_count, $fill_count, $custom_colors, @@ -771,8 +771,8 @@ @{ $worksheet->{_external_hyper_links} }, @{ $worksheet->{_external_drawing_links} }, @{ $worksheet->{_external_vml_links} }, - @{ $worksheet->{_external_table_links} }, @{ $worksheet->{_external_background_links} }, + @{ $worksheet->{_external_table_links} }, @{ $worksheet->{_external_comment_links} }, ); diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Relationships.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Relationships.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Relationships.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Relationships.pm 2023-03-19 12:12:09.000000000 +0000 @@ -20,7 +20,7 @@ use Excel::Writer::XLSX::Package::XMLwriter; our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; our $schema_root = 'http://schemas.openxmlformats.org'; our $package_schema = $schema_root . '/package/2006/relationships'; diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/SharedStrings.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/SharedStrings.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/SharedStrings.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/SharedStrings.pm 2023-03-19 12:12:09.000000000 +0000 @@ -21,7 +21,7 @@ use Excel::Writer::XLSX::Package::XMLwriter; our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Styles.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Styles.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Styles.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Styles.pm 2023-03-19 12:12:09.000000000 +0000 @@ -20,7 +20,7 @@ use Excel::Writer::XLSX::Package::XMLwriter; our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### @@ -45,7 +45,7 @@ $self->{_xf_formats} = undef; $self->{_palette} = []; $self->{_font_count} = 0; - $self->{_num_format_count} = 0; + $self->{_num_formats} = []; $self->{_border_count} = 0; $self->{_fill_count} = 0; $self->{_custom_colors} = []; @@ -126,7 +126,7 @@ $self->{_xf_formats} = shift; $self->{_palette} = shift; $self->{_font_count} = shift; - $self->{_num_format_count} = shift; + $self->{_num_formats} = shift; $self->{_border_count} = shift; $self->{_fill_count} = shift; $self->{_custom_colors} = shift; @@ -203,7 +203,7 @@ sub _write_num_fmts { my $self = shift; - my $count = $self->{_num_format_count}; + my $count = @{ $self->{_num_formats} }; return unless $count; @@ -212,12 +212,11 @@ $self->xml_start_tag( 'numFmts', @attributes ); # Write the numFmts elements. - for my $format ( @{ $self->{_xf_formats} } ) { + my $index = 164; + for my $num_format ( @{ $self->{_num_formats} } ) { - # Ignore built-in number formats, i.e., < 164. - next unless $format->{_num_format_index} >= 164; - $self->_write_num_fmt( $format->{_num_format_index}, - $format->{_num_format} ); + $self->_write_num_fmt( $index, $num_format ); + $index++; } $self->xml_end_tag( 'numFmts' ); @@ -915,6 +914,10 @@ ); + if ( $format->{_quote_prefix} ) { + push @attributes, ( 'quotePrefix' => 1 ); + } + if ( $format->{_num_format_index} > 0 ) { push @attributes, ( 'applyNumberFormat' => 1 ); } diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Table.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Table.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Table.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Table.pm 2023-03-19 12:12:09.000000000 +0000 @@ -20,7 +20,7 @@ use Excel::Writer::XLSX::Package::XMLwriter; our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Theme.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Theme.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/Theme.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/Theme.pm 2023-03-19 12:12:09.000000000 +0000 @@ -30,7 +30,7 @@ use utf8; our @ISA = qw(Exporter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/VML.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/VML.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/VML.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/VML.pm 2023-03-19 12:12:09.000000000 +0000 @@ -20,7 +20,7 @@ use Excel::Writer::XLSX::Package::XMLwriter; our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/XMLwriter.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/XMLwriter.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Package/XMLwriter.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Package/XMLwriter.pm 2023-03-19 12:12:09.000000000 +0000 @@ -21,7 +21,7 @@ use IO::File; our @ISA = qw(Exporter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; # # NOTE: this module is a light weight re-implementation of XML::Writer. See diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Shape.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Shape.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Shape.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Shape.pm 2023-03-19 12:12:09.000000000 +0000 @@ -20,7 +20,7 @@ use Exporter; our @ISA = qw(Exporter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; our $AUTOLOAD; ############################################################################### diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Utility.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Utility.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Utility.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Utility.pm 2023-03-19 12:12:09.000000000 +0000 @@ -21,7 +21,7 @@ use autouse 'Date::Calc' => qw(Delta_DHMS Decode_Date_EU Decode_Date_US); use autouse 'Date::Manip' => qw(ParseDate Date_Init); -our $VERSION = '1.10'; +our $VERSION = '1.11'; # Row and column functions my @rowcol = qw( @@ -34,6 +34,7 @@ xl_dec_row xl_inc_col xl_dec_col + xl_string_pixel_width ); # Date and Time functions @@ -56,6 +57,26 @@ ); +our %CHAR_WIDTHS = ( + ' ' => 3, '!' => 5, '"' => 6, '#' => 7, '$' => 7, '%' => 11, + '&' => 10, "'" => 3, '(' => 5, ')' => 5, '*' => 7, '+' => 7, + ',' => 4, '-' => 5, '.' => 4, '/' => 6, '0' => 7, '1' => 7, + '2' => 7, '3' => 7, '4' => 7, '5' => 7, '6' => 7, '7' => 7, + '8' => 7, '9' => 7, ':' => 4, ';' => 4, '<' => 7, '=' => 7, + '>' => 7, '?' => 7, '@' => 13, 'A' => 9, 'B' => 8, 'C' => 8, + 'D' => 9, 'E' => 7, 'F' => 7, 'G' => 9, 'H' => 9, 'I' => 4, + 'J' => 5, 'K' => 8, 'L' => 6, 'M' => 12, 'N' => 10, 'O' => 10, + 'P' => 8, 'Q' => 10, 'R' => 8, 'S' => 7, 'T' => 7, 'U' => 9, + 'V' => 9, 'W' => 13, 'X' => 8, 'Y' => 7, 'Z' => 7, '[' => 5, + '\\' => 6, ']' => 5, '^' => 7, '_' => 7, '`' => 4, 'a' => 7, + 'b' => 8, 'c' => 6, 'd' => 8, 'e' => 8, 'f' => 5, 'g' => 7, + 'h' => 8, 'i' => 4, 'j' => 4, 'k' => 7, 'l' => 4, 'm' => 12, + 'n' => 8, 'o' => 8, 'p' => 8, 'q' => 8, 'r' => 5, 's' => 6, + 't' => 5, 'u' => 8, 'v' => 7, 'w' => 11, 'x' => 7, 'y' => 7, + 'z' => 6, '{' => 5, '|' => 7, '}' => 5, '~' => 7, +); + + ############################################################################### # # xl_rowcol_to_cell($row, $col, $row_absolute, $col_absolute) @@ -436,6 +457,26 @@ } +############################################################################### +# +# xl_string_pixel_width($string) +# +# Get the pixel width of a string based on individual character widths taken +# from Excel. UTF8 characters are given a default width of 8. +# +# Note, Excel adds an additional 7 pixels padding to a cell. +# +sub xl_string_pixel_width { + my $length = 0; + + for my $char (split //, shift) { + $length += $CHAR_WIDTHS{$char} || 8; + } + + return $length; +} + + 1; @@ -913,4 +954,3 @@ Copyright MM-MMXXIII, John McNamara. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. - diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Workbook.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Workbook.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Workbook.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Workbook.pm 2023-03-19 12:12:09.000000000 +0000 @@ -34,7 +34,7 @@ use Excel::Writer::XLSX::Utility qw(xl_cell_to_rowcol xl_rowcol_to_cell); our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### @@ -81,7 +81,7 @@ $self->{_dxf_format_indices} = {}; $self->{_palette} = []; $self->{_font_count} = 0; - $self->{_num_format_count} = 0; + $self->{_num_formats} = []; $self->{_defined_names} = []; $self->{_named_ranges} = []; $self->{_custom_colors} = []; @@ -1212,8 +1212,13 @@ # Store the xlsx component files with the temp dir name removed. for my $filename ( @xlsx_files ) { - my $short_name = $filename; - $short_name =~ s{^\Q$tempdir\E/?}{}; + # Standardise the Windows paths. + (my $short_name = $filename) =~ s{\\}{/}g; + (my $prefix = $tempdir) =~ s{\\}{/}g; + + # Get the zip subfile name without the tempdir path. + $short_name =~ s{^\Q$prefix\E/?}{}; + my $member = $zip->addFile( $filename, $short_name ); # Set the file member datetime to 1980-01-01 00:00:00 like Excel so @@ -1416,7 +1421,8 @@ my $self = shift; - my %num_formats; + my @num_formats = (); + my %unique_num_formats; my $index = 164; my $num_format_count = 0; @@ -1431,7 +1437,7 @@ if ( $num_format =~ m/^\d+$/ && $num_format !~ m/^0+\d/ ) { # Number format '0' is indexed as 1 in Excel. - if ($num_format == 0) { + if ( $num_format == 0 ) { $num_format = 1; } @@ -1439,33 +1445,34 @@ $format->{_num_format_index} = $num_format; next; } - elsif ( $num_format eq 'General' ) { + elsif ( $num_format eq 'General' ) { + # The 'General' format has an number format index of 0. $format->{_num_format_index} = 0; next; } - - if ( exists( $num_formats{$num_format} ) ) { + if ( exists( $unique_num_formats{$num_format} ) ) { # Number format has already been used. - $format->{_num_format_index} = $num_formats{$num_format}; + $format->{_num_format_index} = $unique_num_formats{$num_format}; } else { - # Add a new number format. - $num_formats{$num_format} = $index; + $unique_num_formats{$num_format} = $index; $format->{_num_format_index} = $index; $index++; - # Only increase font count for XF formats (not for DXF formats). + # Only store/increase number format count for XF formats (not for + # DXF formats). if ( $format->{_xf_index} ) { + push @num_formats, $num_format; $num_format_count++; } } } - $self->{_num_format_count} = $num_format_count; + $self->{_num_formats} = \@num_formats; } diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Worksheet.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Worksheet.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX/Worksheet.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX/Worksheet.pm 2023-03-19 12:12:09.000000000 +0000 @@ -27,10 +27,11 @@ xl_rowcol_to_cell xl_col_to_name xl_range + xl_string_pixel_width quote_sheetname); our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### @@ -82,7 +83,7 @@ $self->{_dim_colmin} = undef; $self->{_dim_colmax} = undef; - $self->{_colinfo} = {}; + $self->{_col_info} = {}; $self->{_selections} = []; $self->{_hidden} = 0; $self->{_active} = 0; @@ -167,6 +168,7 @@ $self->{_default_col_width} = 8.43; $self->{_default_col_pixels} = 64; $self->{_default_row_zeroed} = 0; + $self->{_default_date_pixels} = 68; $self->{_names} = {}; @@ -192,10 +194,9 @@ $self->{_filter_on} = 0; $self->{_filter_range} = []; $self->{_filter_cols} = {}; + $self->{_filter_cells} = {}; - $self->{_col_sizes} = {}; $self->{_row_sizes} = {}; - $self->{_col_formats} = {}; $self->{_col_size_changed} = 0; $self->{_row_size_changed} = 0; @@ -593,37 +594,26 @@ # # _encode_password($password) # -# Based on the algorithm provided by Daniel Rentz of OpenOffice. +# Hash a worksheet password. Based on the algorithm in ECMA-376-4:2016, Office +# Open XML File Formats — Transitional Migration Features, Additional +# attributes for workbookProtection element (Part 1, §18.2.29). # sub _encode_password { + my $self = shift; + my $password = $_[0]; + my $hash = 0; + my $length; - use integer; + foreach my $char ( split //, reverse $password ) { + $hash = ( ( $hash >> 14 ) & 0x01 ) | ( ( $hash << 1 ) & 0x7fff ); + $hash ^= ord $char; + } - my $self = shift; - my $plaintext = $_[0]; - my $password; - my $count; - my @chars; - my $i = 0; - - $count = @chars = split //, $plaintext; - - foreach my $char ( @chars ) { - my $low_15; - my $high_15; - $char = ord( $char ) << ++$i; - $low_15 = $char & 0x7fff; - $high_15 = $char & 0x7fff << 15; - $high_15 = $high_15 >> 15; - $char = $low_15 | $high_15; - } - - $password = 0x0000; - $password ^= $_ for @chars; - $password ^= $count; - $password ^= 0xCE4B; + $hash = ( ( $hash >> 14 ) & 0x01 ) | ( ( $hash << 1 ) & 0x7fff ); + $hash ^= length $password; + $hash ^= 0xCE4B; - return sprintf "%X", $password; + return sprintf "%X", $hash; } @@ -658,7 +648,9 @@ my $width = $data[2]; my $format = $data[3]; my $hidden = $data[4] || 0; - my $level = $data[5]; + my $level = $data[5] || 0; + my $collapsed = $data[6] || 0; + my $autofit = 0; return if not defined $first_col; # Columns must be defined. return if not defined $last_col; @@ -675,8 +667,8 @@ # the column dimensions in certain cases. my $ignore_row = 1; my $ignore_col = 1; - $ignore_col = 0 if ref $format; # Column has a format. - $ignore_col = 0 if $width && $hidden; # Column has a width but is hidden + $ignore_col = 0 if ref $format; # Column has a format. + $ignore_col = 0 if $width && $hidden; # Column has a width but is hidden return -2 if $self->_check_dimensions( 0, $first_col, $ignore_row, $ignore_col ); @@ -688,24 +680,25 @@ $level = 0 if $level < 0; $level = 7 if $level > 7; + + # Excel has a maximumn column width of 255 characters. + if (defined $width && $width > 255.0) { + $width = 255.0; + } + if ( $level > $self->{_outline_col_level} ) { $self->{_outline_col_level} = $level; } - # Store the column data based on the first column. Padded for sorting. - $self->{_colinfo}->{ sprintf "%05d", $first_col } = [ $first_col, $last_col, $width, $format, $hidden, $level ]; + # Store the column data for each column. + foreach my $col ( $first_col .. $last_col ) { + $self->{_col_info}->{$col} = + [ $width, $format, $hidden, $level, $collapsed, $autofit ]; + } + # Store the column change to allow optimisations. $self->{_col_size_changed} = 1; - - # Store the col sizes for use when calculating image vertices taking - # hidden columns into account. Also store the column formats. - $width = $self->{_default_col_width} if !defined $width; - - foreach my $col ( $first_col .. $last_col ) { - $self->{_col_sizes}->{$col} = [$width, $hidden]; - $self->{_col_formats}->{$col} = $format if $format; - } } ############################################################################### @@ -749,6 +742,176 @@ $hidden, $level ); } +############################################################################### +# +# autofit() +# +# Simulate autofit based on the data, and datatypes in each column. We do this +# by estimating a pixel width for each cell data. +# +sub autofit { + my $self = shift; + my %col_width = (); + + # Create a reverse lookup for the share strings table so we can convert + # the string id back to the original string. + my @strings; + while ( my $key = each %{ ${ $self->{_str_table} } } ) { + $strings[ ${ $self->{_str_table} }->{$key} ] = $key; + } + + + # Iterate through all the data in the worksheet. + for my $row_num ( $self->{_dim_rowmin} .. $self->{_dim_rowmax} ) { + + # Skip row if it doesn't contain cell data. + if ( !$self->{_table}->{$row_num} ) { + next; + } + + if ( my $row_ref = $self->{_table}->{$row_num} ) { + for my $col_num ( $self->{_dim_colmin} .. $self->{_dim_colmax} ) { + if ( my $cell = $self->{_table}->{$row_num}->{$col_num} ) { + + # Get the cell type and data. + my $type = $cell->[0]; + my $token = $cell->[1]; + my $length = 0; + + + if ( $type eq 's' || $type eq 'r' ) { + + # Handle strings and rich strings. + # + # For standard shared strings we do a reverse lookup + # from the shared string id to the actual string. For + # rich strings we use the unformatted string. We also + # split multiline strings and handle each part + # separately. + my $string; + + if ( $type eq 's' ) { + + # Handle standard shared strings. + $string = $strings[$token]; + } + else { + # Handle rich strings without html formatting. + $string = $cell->[3]; + } + + if ( $string !~ /\n/ ) { + $length = xl_string_pixel_width( $string ); + } + else { + # Handle multiline strings. + my @segments = split "\n", $string; + for my $string ( @segments ) { + my $seg_length = + xl_string_pixel_width( $string ); + + if ( $seg_length > $length ) { + $length = $seg_length; + } + } + } + } + elsif ( $type eq 'n' ) { + + # Handle numbers. + # + # We use a workaround/optimization for numbers since + # digits all have a pixel width of 7. This gives a + # slightly greater width for the decimal place and + # minus sign but only by a few pixels and + # over-estimation is okay. + $length = 7 * length $token; + } + elsif ( $type eq 't' ) { + + # Handle dates. + # + # The following uses the default width for mm/dd/yyyy + # dates. It isn't feasible to parse the number format + # to get the actual string width for all format types. + $length = $self->{_default_date_pixels}; + } + elsif ( $type eq 'l' ) { + + # Handle boolean values. + # + # Use the Excel standard widths for TRUE and FALSE. + if ( $token ) { + $length = 31; + } + else { + $length = 36; + } + } + elsif ( $type eq 'f' ) { + + # Handle formulas. + # + # We only try to autofit a formula if it has a + # non-zero value. + my $value = $cell->[3]; + if ( $value ) { + $length = xl_string_pixel_width( $value ); + } + } + elsif ( $type eq 'a' || $type eq 'd' ) { + + # Handle array and dynamic formulas. + my $value = $cell->[4]; + if ( $value ) { + $length = xl_string_pixel_width( $value ); + } + } + + + # If the cell is in an autofilter header we add an + # additional 16 pixels for the dropdown arrow. + if ( $length > 0 + && exists $self->{_filter_cells}->{"$row_num:$col_num"} + ) + { + $length += 16; + } + + # Add the string length to the lookup hash. + my $max = $col_width{$col_num} || 0; + if ( $length > $max ) { + $col_width{$col_num} = $length; + + } + } + } + } + } + + # Apply the width to the column. + while ( my ( $col_num, $pixel_width ) = each %col_width ) { + + # Convert the string pixel width to a character width using an + # additional padding of 7 pixels, like Excel. + my $width = _pixels_to_width( $pixel_width + 7 ); + + # The max column character width in Excel is 255. + if ( $width > 255.0 ) { + $width = 255.0; + } + + # Add the width to an existing col info structure or add a new one. + if ( exists $self->{_col_info}->{$col_num} ) { + $self->{_col_info}->{$col_num}->[0] = $width; + $self->{_col_info}->{$col_num}->[5] = 1; + } + else { + $self->{_col_info}->{$col_num} = [ $width, undef, 0, 0, 0, 1 ]; + } + } +} + ############################################################################### # @@ -1390,6 +1553,12 @@ $self->{_autofilter} = $area; $self->{_autofilter_ref} = $ref; $self->{_filter_range} = [ $col1, $col2 ]; + + # Store the filter cell positions for use in the autofit calculation. + for my $col ($col1 .. $col2) { + $self->{_filter_cells}->{ "$row1:$col"} = 1; + } + } @@ -2447,10 +2616,10 @@ my $col = shift; # Zero indexed column. my $str = ''; my $xf = undef; - my $type = 's'; # The data type. - my $length = 0; # String length. + my $type = 'r'; # The data type. my $index; my $str_error = 0; + my $raw_string = ''; # Check that row and col are valid and store max and min values return -2 if $self->_check_dimensions( $row, $col ); @@ -2496,7 +2665,8 @@ push @fragments, $token; } - $length += length $token; # Keep track of actual string length. + $raw_string .= $token; # Keep track of the unformatted string. + $last = 'string'; } else { @@ -2543,7 +2713,7 @@ } # Check that the string is < 32767 chars. - if ( $length > $self->{_xls_strmax} ) { + if ( length $raw_string > $self->{_xls_strmax} ) { return -3; } @@ -2561,7 +2731,7 @@ $self->_write_single_row( $row ); } - $self->{_table}->{$row}->{$col} = [ $type, $index, $xf ]; + $self->{_table}->{$row}->{$col} = [ $type, $index, $xf, $raw_string ]; return 0; } @@ -3242,7 +3412,7 @@ my $col = $_[1]; # Zero indexed column my $str = $_[2]; my $xf = $_[3]; # The cell format - my $type = 'n'; # The data type + my $type = 't'; # The data type # Check that row and col are valid and store max and min values @@ -4921,6 +5091,13 @@ } + # Store the filter cell positions for use in the autofit calculation. + if ( $param->{autofilter} ) { + for my $col ($col1 .. $col2) { + $self->{_filter_cells}->{ "$row1:$col" } = 1; + } + } + # Store the table data. push @{ $self->{_tables} }, \%table; @@ -5760,10 +5937,13 @@ # Look up the cell value to see if it has been changed. - if ( exists $self->{_col_sizes}->{$col} ) + if ( exists $self->{_col_info}->{$col} ) { - my $width = $self->{_col_sizes}->{$col}[0]; - my $hidden = $self->{_col_sizes}->{$col}[1]; + my $width = $self->{_col_info}->{$col}[0]; + my $hidden = $self->{_col_info}->{$col}[2]; + + $width = $self->{_default_col_width} if !defined $width; + # Convert to pixels. if ( $hidden == 1 && $anchor != 4 ) { @@ -6125,12 +6305,12 @@ my $token = $cell->[1]; - if ( $type eq 'n' ) { + if ( $type eq 'n' || $type eq 't') { # Store a number. push @data, $token; } - elsif ( $type eq 's' ) { + elsif ( $type eq 's' || $type eq 'r' ) { # Store a string. if ( $self->{_optimization} == 0 ) { @@ -7213,6 +7393,42 @@ } +# Helper function to compare adjacent column information structures. +sub _compare_col_info { + my $col_options = shift; + my $previous_options = shift; + + if ( defined $col_options->[0] != defined $previous_options->[0] ) { + return undef; + } + + if ( defined $col_options->[0] + && defined $previous_options->[0] + && $col_options->[0] != $previous_options->[0] ) + { + return undef; + } + + if ( defined $col_options->[1] != defined $previous_options->[1] ) { + return undef; + } + + if ( defined $col_options->[1] + && defined $previous_options->[1] + && $col_options->[1] != $previous_options->[1] ) + { + return undef; + } + + return undef if $col_options->[2] != $previous_options->[2]; + return undef if $col_options->[3] != $previous_options->[3]; + return undef if $col_options->[4] != $previous_options->[4]; + return undef if $col_options->[5] != $previous_options->[5]; + + return 1; +} + + ############################################################################### # # XML writing methods. @@ -7577,18 +7793,55 @@ my $self = shift; # Exit unless some column have been formatted. - return unless %{ $self->{_colinfo} }; + return unless %{ $self->{_col_info} }; $self->xml_start_tag( 'cols' ); - for my $col ( sort keys %{ $self->{_colinfo} } ) { - $self->_write_col_info( @{ $self->{_colinfo}->{$col} } ); + + # Use the first element of the column information structures to set + # the initial/previous properties. + my $first_col = ( sort { $a <=> $b } keys %{ $self->{_col_info} } )[0]; + my $last_col = $first_col; + my $previous_options = $self->{_col_info}->{$first_col}; + my $deleted_col = $first_col; + my $deleted_col_options = $previous_options; + + delete $self->{_col_info}->{$first_col}; + + for my $col ( sort { $a <=> $b } keys %{ $self->{_col_info} } ) { + my $col_options = $self->{_col_info}->{$col}; + + # Check if the column number is contiguous with the previous + # column and if the properties are the same. + if ( $col == $last_col + 1 + && _compare_col_info( $col_options, $previous_options ) ) + { + $last_col = $col; + } + else { + # If not contiguous/equal then we write out the current range + # of columns and start again. + $self->_write_col_info( $first_col, $last_col, @$previous_options ); + $first_col = $col; + $last_col = $first_col; + $previous_options = $col_options; + } } + # We will exit the previous loop with one unhandled column range. + $self->_write_col_info( $first_col, $last_col, @$previous_options ); + + + # Put back the deleted first column information structure. + $self->{_col_info}->{$deleted_col} = $deleted_col_options; + $self->xml_end_tag( 'cols' ); } + + + ############################################################################## # # _write_col_info() @@ -7604,7 +7857,8 @@ my $format = $_[3]; # Format index. my $hidden = $_[4] || 0; # Hidden flag. my $level = $_[5] || 0; # Outline level. - my $collapsed = $_[6] || 0; # Outline level. + my $collapsed = $_[6] || 0; # Outline collapsed. + my $autofit = $_[7] || 0; # Best fit for autofit numbers. my $custom_width = 1; my $xf_index = 0; @@ -7659,6 +7913,7 @@ push @attributes, ( 'style' => $xf_index ) if $xf_index; push @attributes, ( 'hidden' => 1 ) if $hidden; + push @attributes, ( 'bestFit' => 1 ) if $autofit; push @attributes, ( 'customWidth' => 1 ) if $custom_width; push @attributes, ( 'outlineLevel' => $level ) if $level; push @attributes, ( 'collapsed' => 1 ) if $collapsed; @@ -8057,19 +8312,21 @@ my $row_xf = $self->{_set_rows}->{$row}->[1]; push @attributes, ( 's' => $row_xf->get_xf_index() ); } - elsif ( $self->{_col_formats}->{$col} ) { - my $col_xf = $self->{_col_formats}->{$col}; - push @attributes, ( 's' => $col_xf->get_xf_index() ); + elsif ( $self->{_col_info}->{$col} ) { + my $col_xf = $self->{_col_info}->{$col}->[1]; + if (defined $col_xf) { + push @attributes, ( 's' => $col_xf->get_xf_index() ); + } } # Write the various cell types. - if ( $type eq 'n' ) { + if ( $type eq 'n' || $type eq 't' ) { # Write a number. $self->xml_number_element( $token, @attributes ); } - elsif ( $type eq 's' ) { + elsif ( $type eq 's' || $type eq 'r' ) { # Write a string. if ( $self->{_optimization} == 0 ) { diff -Nru libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX.pm libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX.pm --- libexcel-writer-xlsx-perl-1.10/lib/Excel/Writer/XLSX.pm 2022-12-30 20:12:05.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/lib/Excel/Writer/XLSX.pm 2023-03-19 12:23:42.000000000 +0000 @@ -1,3 +1,4 @@ + package Excel::Writer::XLSX; ############################################################################### @@ -17,7 +18,7 @@ use Excel::Writer::XLSX::Workbook; our @ISA = qw(Excel::Writer::XLSX::Workbook Exporter); -our $VERSION = '1.10'; +our $VERSION = '1.11'; ############################################################################### @@ -2130,7 +2131,7 @@ $worksheet->protect( 'drowssap' ); -Passing the empty string C<''> is the same as turning on protection without a password. +The password should be an ASCII string. Passing the empty string C<''> is the same as turning on protection without a password. Note, the worksheet level password in Excel provides very weak protection. It does not encrypt your data and is very easy to deactivate. Full workbook encryption is not supported by C since it requires a completely different file format and would take several man months to implement. @@ -4159,6 +4160,20 @@ + +=head2 set_quote_prefix() + + Default state: quote prefix is off + Default action: Turn quote prefix on + Valid args: 0, 1 + +Set the quote prefix property of a format to ensure a string is treated as a string after editing. This is the same as prefixing the string with a single quote in Excel. You don't need to add the quote to the string but you do need to add the format. + +Set the quote prefix property of the format: + + $format->set_quote_prefix(); # Turn quote prefix on + + =head2 copy( $format ) This method is used to copy all of the properties from one Format object to another: @@ -7211,6 +7226,7 @@ Intermediate ============ + autofit.pl Examples of simulated worksheet autofit. autofilter.pl Examples of worksheet autofilters. array_formula.pl Examples of how to write array formulas. cgi.pl A simple CGI program. @@ -7240,6 +7256,7 @@ date_time.pl Write dates and times with write_date_time(). defined_name.pl Example of how to create defined names. diag_border.pl A simple example of diagonal cell borders. + dynamic_arrays.pl Example of using new Excel 365 dynamic functions. filehandle.pl Examples of working with filehandles. headers.pl Examples of worksheet headers and footers. hide_row_col.pl Example of hiding rows and columns. @@ -7248,6 +7265,7 @@ hyperlink2.pl Examples of internal and external hyperlinks. indent.pl An example of cell indentation. ignore_errors.pl An example of turning off worksheet cells errors/warnings. + lambda.pl Example of using the Excel 365 LAMBDA() function. macros.pl An example of adding macros from an existing file. merge1.pl A simple example of cell merging. merge2.pl A simple example of cell merging with formatting. @@ -7288,7 +7306,6 @@ write_handler4.pl Example of extending the write() method. Step 4. write_to_scalar.pl Example of writing an Excel file to a Perl scalar. - Unicode ======= unicode_2022_jp.pl Japanese: ISO-2022-JP. diff -Nru libexcel-writer-xlsx-perl-1.10/MANIFEST libexcel-writer-xlsx-perl-1.11/MANIFEST --- libexcel-writer-xlsx-perl-1.10/MANIFEST 2022-12-30 21:02:13.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/MANIFEST 2023-03-19 12:28:18.000000000 +0000 @@ -12,6 +12,7 @@ examples/a_simple.pl examples/array_formula.pl examples/autofilter.pl +examples/autofit.pl examples/background.pl examples/bug_report.pl examples/cgi.pl @@ -324,6 +325,19 @@ t/regression/autofilter09.t t/regression/autofilter10.t t/regression/autofilter11.t +t/regression/autofit01.t +t/regression/autofit02.t +t/regression/autofit03.t +t/regression/autofit04.t +t/regression/autofit05.t +t/regression/autofit06.t +t/regression/autofit07.t +t/regression/autofit08.t +t/regression/autofit09.t +t/regression/autofit10.t +t/regression/autofit11.t +t/regression/autofit12.t +t/regression/autofit13.t t/regression/background01.t t/regression/background02.t t/regression/background03.t @@ -814,6 +828,8 @@ t/regression/format15.t t/regression/format16.t t/regression/format17.t +t/regression/format18.t +t/regression/format19.t t/regression/formula_results01.t t/regression/gridlines01.t t/regression/header01.t @@ -1063,6 +1079,7 @@ t/regression/protect05.t t/regression/protect06.t t/regression/protect07.t +t/regression/protect08.t t/regression/quote_name01.t t/regression/quote_name02.t t/regression/quote_name03.t @@ -1163,6 +1180,10 @@ t/regression/table24.t t/regression/table25.t t/regression/table26.t +t/regression/table27.t +t/regression/table28.t +t/regression/table29.t +t/regression/table30.t t/regression/taint01.t t/regression/taint02.t t/regression/top_left_cell01.t @@ -1204,6 +1225,19 @@ t/regression/xlsx_files/autofilter09.xlsx t/regression/xlsx_files/autofilter10.xlsx t/regression/xlsx_files/autofilter11.xlsx +t/regression/xlsx_files/autofit01.xlsx +t/regression/xlsx_files/autofit02.xlsx +t/regression/xlsx_files/autofit03.xlsx +t/regression/xlsx_files/autofit04.xlsx +t/regression/xlsx_files/autofit05.xlsx +t/regression/xlsx_files/autofit06.xlsx +t/regression/xlsx_files/autofit07.xlsx +t/regression/xlsx_files/autofit08.xlsx +t/regression/xlsx_files/autofit09.xlsx +t/regression/xlsx_files/autofit10.xlsx +t/regression/xlsx_files/autofit11.xlsx +t/regression/xlsx_files/autofit12.xlsx +t/regression/xlsx_files/autofit13.xlsx t/regression/xlsx_files/background01.xlsx t/regression/xlsx_files/background02.xlsx t/regression/xlsx_files/background03.xlsx @@ -1680,6 +1714,8 @@ t/regression/xlsx_files/format15.xlsx t/regression/xlsx_files/format16.xlsx t/regression/xlsx_files/format17.xlsx +t/regression/xlsx_files/format18.xlsx +t/regression/xlsx_files/format19.xlsx t/regression/xlsx_files/formula_results01.xlsx t/regression/xlsx_files/gridlines01.xlsx t/regression/xlsx_files/header01.xlsx @@ -1895,6 +1931,7 @@ t/regression/xlsx_files/protect05.xlsx t/regression/xlsx_files/protect06.xlsx t/regression/xlsx_files/protect07.xlsx +t/regression/xlsx_files/protect08.xlsx t/regression/xlsx_files/quote_name01.xlsx t/regression/xlsx_files/quote_name02.xlsx t/regression/xlsx_files/quote_name03.xlsx @@ -1988,6 +2025,10 @@ t/regression/xlsx_files/table24.xlsx t/regression/xlsx_files/table25.xlsx t/regression/xlsx_files/table26.xlsx +t/regression/xlsx_files/table27.xlsx +t/regression/xlsx_files/table28.xlsx +t/regression/xlsx_files/table29.xlsx +t/regression/xlsx_files/table30.xlsx t/regression/xlsx_files/taint01.xlsx t/regression/xlsx_files/taint02.xlsx t/regression/xlsx_files/top_left_cell01.xlsx @@ -2032,6 +2073,7 @@ t/utility/xl_range.t t/utility/xl_range_formula.t t/utility/xl_rowcol_to_cell.t +t/utility/xl_string_pixel_width.t t/workbook/sub_close.t t/workbook/sub_get_chart_range.t t/workbook/sub_sort_defined_names.t @@ -2166,6 +2208,7 @@ t/worksheet/worksheet_data_bar_11.t t/worksheet/worksheet_data_bar_12.t t/worksheet/worksheet_data_bar_13.t +t/worksheet/worksheet_encode_password.t t/worksheet/worksheet_merge_cells_01.t t/worksheet/worksheet_merge_cells_02.t t/worksheet/worksheet_merge_cells_03.t diff -Nru libexcel-writer-xlsx-perl-1.10/META.json libexcel-writer-xlsx-perl-1.11/META.json --- libexcel-writer-xlsx-perl-1.10/META.json 2022-12-30 21:02:12.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/META.json 2023-03-19 12:28:18.000000000 +0000 @@ -48,5 +48,5 @@ "url" : "http://github.com/jmcnamara/excel-writer-xlsx" } }, - "version" : "1.10" + "version" : "1.11" } diff -Nru libexcel-writer-xlsx-perl-1.10/META.yml libexcel-writer-xlsx-perl-1.11/META.yml --- libexcel-writer-xlsx-perl-1.10/META.yml 2022-12-30 21:02:12.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/META.yml 2023-03-19 12:28:18.000000000 +0000 @@ -25,4 +25,4 @@ bugtracker: http://github.com/jmcnamara/excel-writer-xlsx/issues homepage: http://github.com/jmcnamara/excel-writer-xlsx repository: http://github.com/jmcnamara/excel-writer-xlsx -version: '1.10' +version: '1.11' diff -Nru libexcel-writer-xlsx-perl-1.10/README libexcel-writer-xlsx-perl-1.11/README --- libexcel-writer-xlsx-perl-1.10/README 2022-12-30 20:11:48.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/README 2023-03-19 12:12:09.000000000 +0000 @@ -71,7 +71,7 @@ Unzip and untar the module as follows: - tar -zxvf Excel-Writer-XLSX-1.10.tar.gz + tar -zxvf Excel-Writer-XLSX-1.11.tar.gz The module can be installed using the standard Perl procedure: diff -Nru libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_01.t libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_01.t --- libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_01.t 2022-12-30 20:12:06.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_01.t 2023-03-06 20:22:37.000000000 +0000 @@ -44,7 +44,7 @@ $workbook->{_xf_formats}, $workbook->{_palette}, $workbook->{_font_count}, - $workbook->{_num_format_count}, + $workbook->{_num_formats}, $workbook->{_border_count}, $workbook->{_fill_count}, $workbook->{_custom_colors}, diff -Nru libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_02.t libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_02.t --- libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_02.t 2022-12-30 20:12:06.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_02.t 2023-03-06 20:22:50.000000000 +0000 @@ -49,7 +49,7 @@ $workbook->{_xf_formats}, $workbook->{_palette}, $workbook->{_font_count}, - $workbook->{_num_format_count}, + $workbook->{_num_formats}, $workbook->{_border_count}, $workbook->{_fill_count}, $workbook->{_custom_colors}, diff -Nru libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_03.t libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_03.t --- libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_03.t 2022-12-30 20:12:06.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_03.t 2023-03-06 20:22:58.000000000 +0000 @@ -49,7 +49,7 @@ $workbook->{_xf_formats}, $workbook->{_palette}, $workbook->{_font_count}, - $workbook->{_num_format_count}, + $workbook->{_num_formats}, $workbook->{_border_count}, $workbook->{_fill_count}, $workbook->{_custom_colors}, diff -Nru libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_04.t libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_04.t --- libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_04.t 2022-12-30 20:12:06.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_04.t 2023-03-06 20:23:06.000000000 +0000 @@ -59,7 +59,7 @@ $workbook->{_xf_formats}, $workbook->{_palette}, $workbook->{_font_count}, - $workbook->{_num_format_count}, + $workbook->{_num_formats}, $workbook->{_border_count}, $workbook->{_fill_count}, $workbook->{_custom_colors}, diff -Nru libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_05.t libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_05.t --- libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_05.t 2022-12-30 20:12:06.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_05.t 2023-03-06 20:23:15.000000000 +0000 @@ -53,7 +53,7 @@ $workbook->{_xf_formats}, $workbook->{_palette}, $workbook->{_font_count}, - $workbook->{_num_format_count}, + $workbook->{_num_formats}, $workbook->{_border_count}, $workbook->{_fill_count}, $workbook->{_custom_colors}, diff -Nru libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_06.t libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_06.t --- libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_06.t 2022-12-30 20:12:06.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_06.t 2023-03-06 20:23:23.000000000 +0000 @@ -59,7 +59,7 @@ $workbook->{_xf_formats}, $workbook->{_palette}, $workbook->{_font_count}, - $workbook->{_num_format_count}, + $workbook->{_num_formats}, $workbook->{_border_count}, $workbook->{_fill_count}, $workbook->{_custom_colors}, diff -Nru libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_07.t libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_07.t --- libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_07.t 2022-12-30 20:12:06.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_07.t 2023-03-06 20:23:31.000000000 +0000 @@ -58,7 +58,7 @@ $workbook->{_xf_formats}, $workbook->{_palette}, $workbook->{_font_count}, - $workbook->{_num_format_count}, + $workbook->{_num_formats}, $workbook->{_border_count}, $workbook->{_fill_count}, $workbook->{_custom_colors}, diff -Nru libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_08.t libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_08.t --- libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_08.t 2022-12-30 20:12:06.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_08.t 2023-03-06 20:23:38.000000000 +0000 @@ -64,7 +64,7 @@ $workbook->{_xf_formats}, $workbook->{_palette}, $workbook->{_font_count}, - $workbook->{_num_format_count}, + $workbook->{_num_formats}, $workbook->{_border_count}, $workbook->{_fill_count}, $workbook->{_custom_colors}, diff -Nru libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_09.t libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_09.t --- libexcel-writer-xlsx-perl-1.10/t/package/styles/styles_09.t 2022-12-30 20:12:06.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/package/styles/styles_09.t 2023-03-06 20:23:47.000000000 +0000 @@ -56,7 +56,7 @@ $workbook->{_xf_formats}, $workbook->{_palette}, $workbook->{_font_count}, - $workbook->{_num_format_count}, + $workbook->{_num_formats}, $workbook->{_border_count}, $workbook->{_fill_count}, $workbook->{_custom_colors}, diff -Nru libexcel-writer-xlsx-perl-1.10/t/package/styles/sub_write_num_fmts.t libexcel-writer-xlsx-perl-1.11/t/package/styles/sub_write_num_fmts.t --- libexcel-writer-xlsx-perl-1.10/t/package/styles/sub_write_num_fmts.t 2022-12-30 20:12:06.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/package/styles/sub_write_num_fmts.t 2023-03-06 20:24:36.000000000 +0000 @@ -62,7 +62,7 @@ $got = ''; # Since it was previously undef. $style = _new_style( \$got ); -$style->_set_style_properties( \@formats, undef, undef, $num_format_count ); +$style->_set_style_properties( \@formats, undef, undef, ['#,##0.0'] ); $style->_write_num_fmts(); diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/autofit01.t libexcel-writer-xlsx-perl-1.11/t/regression/autofit01.t --- libexcel-writer-xlsx-perl-1.10/t/regression/autofit01.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/autofit01.t 2023-01-03 23:55:34.000000000 +0000 @@ -0,0 +1,69 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'autofit01.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +$worksheet->write_string( 0, 0, "A" ); + +$worksheet->set_column( "A:A", 1.57 ); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/autofit02.t libexcel-writer-xlsx-perl-1.11/t/regression/autofit02.t --- libexcel-writer-xlsx-perl-1.10/t/regression/autofit02.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/autofit02.t 2023-03-06 16:40:58.000000000 +0000 @@ -0,0 +1,69 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'autofit02.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +$worksheet->write_string( 0, 0, "A" ); + +$worksheet->autofit(); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/autofit03.t libexcel-writer-xlsx-perl-1.11/t/regression/autofit03.t --- libexcel-writer-xlsx-perl-1.10/t/regression/autofit03.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/autofit03.t 2023-01-04 00:02:25.000000000 +0000 @@ -0,0 +1,72 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'autofit03.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +$worksheet->write_string( 0, 0, "A" ); +$worksheet->write_string( 0, 1, "A" ); + +$worksheet->autofit(); + +$worksheet->set_column( "B:B", 1.57 ); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/autofit04.t libexcel-writer-xlsx-perl-1.11/t/regression/autofit04.t --- libexcel-writer-xlsx-perl-1.10/t/regression/autofit04.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/autofit04.t 2023-01-04 00:02:47.000000000 +0000 @@ -0,0 +1,72 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'autofit04.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +$worksheet->write( 0, 0, "Hello" ); +$worksheet->write( 0, 1, "World" ); +$worksheet->write( 0, 2, 123 ); +$worksheet->write( 0, 3, 1234567 ); + +$worksheet->autofit(); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/autofit05.t libexcel-writer-xlsx-perl-1.11/t/regression/autofit05.t --- libexcel-writer-xlsx-perl-1.10/t/regression/autofit05.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/autofit05.t 2023-01-04 00:30:25.000000000 +0000 @@ -0,0 +1,72 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'autofit05.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +my $date_format = $workbook->add_format( num_format => 14 ); + +$worksheet->write_date_time( 0, 0, '2023-01-01T', $date_format ); +$worksheet->write_date_time( 0, 1, '2023-12-12T', $date_format ); + +$worksheet->autofit(); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/autofit06.t libexcel-writer-xlsx-perl-1.11/t/regression/autofit06.t --- libexcel-writer-xlsx-perl-1.10/t/regression/autofit06.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/autofit06.t 2023-01-04 00:38:33.000000000 +0000 @@ -0,0 +1,70 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'autofit06.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +$worksheet->write_boolean( 0, 0, 1 ); +$worksheet->write_boolean( 0, 1, 0 ); + +$worksheet->autofit(); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/autofit07.t libexcel-writer-xlsx-perl-1.11/t/regression/autofit07.t --- libexcel-writer-xlsx-perl-1.10/t/regression/autofit07.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/autofit07.t 2023-01-04 00:54:02.000000000 +0000 @@ -0,0 +1,69 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'autofit07.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +$worksheet->write_url( 0, 0, 'http://a.b/' ); + +$worksheet->autofit(); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/autofit08.t libexcel-writer-xlsx-perl-1.11/t/regression/autofit08.t --- libexcel-writer-xlsx-perl-1.10/t/regression/autofit08.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/autofit08.t 2023-01-04 01:01:32.000000000 +0000 @@ -0,0 +1,73 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'autofit08.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +$worksheet->write_string( 0, 0, "a" ); +$worksheet->write_string( 1, 0, "aaa" ); +$worksheet->write_string( 2, 0, "a" ); +$worksheet->write_string( 3, 0, "aaaa" ); +$worksheet->write_string( 4, 0, "a" ); + +$worksheet->autofit(); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/autofit09.t libexcel-writer-xlsx-perl-1.11/t/regression/autofit09.t --- libexcel-writer-xlsx-perl-1.10/t/regression/autofit09.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/autofit09.t 2023-01-04 09:34:29.000000000 +0000 @@ -0,0 +1,75 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'autofit09.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +my $text_wrap = $workbook->add_format( text_wrap => 1 ); + +$worksheet->write_string( 0, 0, "Hello\nFoo", $text_wrap ); +$worksheet->write_string( 2, 2, "Foo\nBamboo\nBar", $text_wrap ); + +$worksheet->set_row(0, 33); +$worksheet->set_row(2, 48); + +$worksheet->autofit(); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/autofit10.t libexcel-writer-xlsx-perl-1.11/t/regression/autofit10.t --- libexcel-writer-xlsx-perl-1.10/t/regression/autofit10.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/autofit10.t 2023-01-04 10:58:42.000000000 +0000 @@ -0,0 +1,74 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'autofit10.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + + +my $bold = $workbook->add_format( bold => 1 ); + +$worksheet->write_rich_string( 0, 0, "F", $bold, 'o', 'o', $bold, 'b', 'a', $bold, 'r'); + +$worksheet->write(1, 0, "Bar", $bold ); + +$worksheet->autofit(); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/autofit11.t libexcel-writer-xlsx-perl-1.11/t/regression/autofit11.t --- libexcel-writer-xlsx-perl-1.10/t/regression/autofit11.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/autofit11.t 2023-01-04 11:50:08.000000000 +0000 @@ -0,0 +1,71 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'autofit11.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = [ 'xl/calcChain.xml', + '\[Content_Types\].xml', + 'xl/_rels/workbook.xml.rels' ]; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +$worksheet->write_formula( 0, 0, "=9999+1", undef, 10000 ); + +$worksheet->autofit(); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/autofit12.t libexcel-writer-xlsx-perl-1.11/t/regression/autofit12.t --- libexcel-writer-xlsx-perl-1.10/t/regression/autofit12.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/autofit12.t 2023-01-04 12:02:14.000000000 +0000 @@ -0,0 +1,84 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'autofit12.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = [ 'xl/calcChain.xml', + '\[Content_Types\].xml', + 'xl/_rels/workbook.xml.rels' ]; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +$worksheet->write_array_formula( 0, 0, 2, 0, '{=SUM(B1:C1*B2:C2)}', undef, 1000 ); + + +$worksheet->write(0, 1, 20); +$worksheet->write(1, 1, 30); +$worksheet->write(2, 1, 40); + +$worksheet->write(0, 2, 10); +$worksheet->write(1, 2, 40); +$worksheet->write(2, 2, 20); + +$worksheet->autofit(); + +# Put these after the autofit() so that the autofit in on the formula result. +$worksheet->write(1, 0, 1000); +$worksheet->write(2, 0, 1000); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/autofit13.t libexcel-writer-xlsx-perl-1.11/t/regression/autofit13.t --- libexcel-writer-xlsx-perl-1.10/t/regression/autofit13.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/autofit13.t 2023-01-13 23:42:36.000000000 +0000 @@ -0,0 +1,73 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'autofit13.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +$worksheet->write_string( 0, 0, "Foo" ); +$worksheet->write_string( 0, 1, "Foo bar" ); +$worksheet->write_string( 0, 2, "Foo bar bar" ); + +$worksheet->autofilter(0, 0, 0, 2); + +$worksheet->autofit(); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/format18.t libexcel-writer-xlsx-perl-1.11/t/regression/format18.t --- libexcel-writer-xlsx-perl-1.10/t/regression/format18.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/format18.t 2023-01-09 20:18:19.000000000 +0000 @@ -0,0 +1,70 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'format18.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file with a quote prefix. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +my $quote = $workbook->add_format( quote_prefix => 1 ); + +$worksheet->write_string( 0, 0, "= Hello", $quote ); + + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/format19.t libexcel-writer-xlsx-perl-1.11/t/regression/format19.t --- libexcel-writer-xlsx-perl-1.10/t/regression/format19.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/format19.t 2023-03-06 17:37:19.000000000 +0000 @@ -0,0 +1,68 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'format19.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file with unused formats. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +my $format1 = $workbook->add_format( num_format => 'hh:mm;@' ); +my $format2 = $workbook->add_format( num_format => 'hh:mm;@', bg_color => 'yellow' ); + +$worksheet->write( 0, 0, 1, $format1 ); +$worksheet->write( 1, 0, 2, $format2 ); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/protect08.t libexcel-writer-xlsx-perl-1.11/t/regression/protect08.t --- libexcel-writer-xlsx-perl-1.10/t/regression/protect08.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/protect08.t 2023-01-11 15:52:47.000000000 +0000 @@ -0,0 +1,89 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'protect08.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the a simple Excel::Writer::XLSX file with worksheet protection. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + + + +my %options = ( + objects => 1, + scenarios => 1, + format_cells => 1, + format_columns => 1, + format_rows => 1, + insert_columns => 1, + insert_rows => 1, + insert_hyperlinks => 1, + delete_columns => 1, + delete_rows => 1, + select_locked_cells => 0, + sort => 1, + autofilter => 1, + pivot_tables => 1, + select_unlocked_cells => 0, +); + + +$worksheet->protect( "", \%options ); + + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/table27.t libexcel-writer-xlsx-perl-1.11/t/regression/table27.t --- libexcel-writer-xlsx-perl-1.10/t/regression/table27.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/table27.t 2023-01-13 23:42:49.000000000 +0000 @@ -0,0 +1,73 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'table27.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file with tables. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + + +# Add the table. +$worksheet->add_table('C3:F13'); + +# Test autofitting the columns. +$worksheet->autofit(); + + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/table28.t libexcel-writer-xlsx-perl-1.11/t/regression/table28.t --- libexcel-writer-xlsx-perl-1.10/t/regression/table28.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/table28.t 2023-01-14 00:12:45.000000000 +0000 @@ -0,0 +1,73 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'table28.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file with tables. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + + +# Add the table. +$worksheet->add_table('C3:F13', { autofilter => 0 }); + +# Test autofitting the columns. +$worksheet->autofit(); + + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/table29.t libexcel-writer-xlsx-perl-1.11/t/regression/table29.t --- libexcel-writer-xlsx-perl-1.10/t/regression/table29.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/table29.t 2023-01-31 00:22:58.000000000 +0000 @@ -0,0 +1,74 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'table29.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file with tables. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +# Set the column width to match the target worksheet. +$worksheet->set_column('C:F', 10.288); + +# Add the table. +$worksheet->add_table('C3:F13'); + + +$worksheet->insert_image( 0, 0, $dir . 'images/red.png' ); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + diff -Nru libexcel-writer-xlsx-perl-1.10/t/regression/table30.t libexcel-writer-xlsx-perl-1.11/t/regression/table30.t --- libexcel-writer-xlsx-perl-1.10/t/regression/table30.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/regression/table30.t 2023-01-31 17:42:59.000000000 +0000 @@ -0,0 +1,73 @@ +############################################################################### +# +# Tests the output of Excel::Writer::XLSX against Excel generated files. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_compare_xlsx_files _is_deep_diff); +use strict; +use warnings; + +use Test::More tests => 1; + +############################################################################### +# +# Tests setup. +# +my $filename = 'table30.xlsx'; +my $dir = 't/regression/'; +my $got_filename = $dir . "ewx_$filename"; +my $exp_filename = $dir . 'xlsx_files/' . $filename; + +my $ignore_members = []; +my $ignore_elements = {}; + + +############################################################################### +# +# Test the creation of a simple Excel::Writer::XLSX file with tables. +# +use Excel::Writer::XLSX; + +my $workbook = Excel::Writer::XLSX->new( $got_filename ); +my $worksheet = $workbook->add_worksheet(); + +# Set the column width to match the target worksheet. +$worksheet->set_column('C:F', 10.288); + +# Add the table. +$worksheet->add_table('C3:F13'); + +$worksheet->set_background( $dir . 'images/logo.jpg' ); + +$workbook->close(); + + +############################################################################### +# +# Compare the generated and existing Excel files. +# + +my ( $got, $expected, $caption ) = _compare_xlsx_files( + + $got_filename, + $exp_filename, + $ignore_members, + $ignore_elements, +); + +_is_deep_diff( $got, $expected, $caption ); + + +############################################################################### +# +# Cleanup. +# +unlink $got_filename; + +__END__ + + + Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/autofit01.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/autofit01.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/autofit02.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/autofit02.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/autofit03.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/autofit03.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/autofit04.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/autofit04.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/autofit05.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/autofit05.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/autofit06.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/autofit06.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/autofit07.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/autofit07.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/autofit08.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/autofit08.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/autofit09.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/autofit09.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/autofit10.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/autofit10.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/autofit11.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/autofit11.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/autofit12.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/autofit12.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/autofit13.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/autofit13.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/format18.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/format18.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/format19.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/format19.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/protect08.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/protect08.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/table27.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/table27.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/table28.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/table28.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/table29.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/table29.xlsx differ Binary files /tmp/tmpkeeig2kc/VhHFjFwY4p/libexcel-writer-xlsx-perl-1.10/t/regression/xlsx_files/table30.xlsx and /tmp/tmpkeeig2kc/ZEsXWuiNtJ/libexcel-writer-xlsx-perl-1.11/t/regression/xlsx_files/table30.xlsx differ diff -Nru libexcel-writer-xlsx-perl-1.10/t/utility/xl_string_pixel_width.t libexcel-writer-xlsx-perl-1.11/t/utility/xl_string_pixel_width.t --- libexcel-writer-xlsx-perl-1.10/t/utility/xl_string_pixel_width.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/utility/xl_string_pixel_width.t 2023-01-03 19:51:27.000000000 +0000 @@ -0,0 +1,135 @@ +############################################################################### +# +# Tests for Excel::Writer::XLSX::Utility. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use strict; +use warnings; +use Excel::Writer::XLSX::Utility qw(xl_string_pixel_width); + +use utf8; +use Test::More tests => 100; + + +############################################################################### +# +# Test the xl_string_pixel_width() function. +# +my @tests = ( + + [ " " => 3 ], + [ "!" => 5 ], + [ '"' => 6 ], + [ "#" => 7 ], + [ "\$" => 7 ], + [ "%" => 11 ], + [ "&" => 10 ], + [ "'" => 3 ], + [ "(" => 5 ], + [ ")" => 5 ], + [ "*" => 7 ], + [ "+" => 7 ], + [ "," => 4 ], + [ "-" => 5 ], + [ "." => 4 ], + [ "/" => 6 ], + [ "0" => 7 ], + [ "1" => 7 ], + [ "2" => 7 ], + [ "3" => 7 ], + [ "4" => 7 ], + [ "5" => 7 ], + [ "6" => 7 ], + [ "7" => 7 ], + [ "8" => 7 ], + [ "9" => 7 ], + [ ":" => 4 ], + [ ";" => 4 ], + [ "<" => 7 ], + [ "=" => 7 ], + [ ">" => 7 ], + [ "?" => 7 ], + [ "@" => 13 ], + [ "A" => 9 ], + [ "B" => 8 ], + [ "C" => 8 ], + [ "D" => 9 ], + [ "E" => 7 ], + [ "F" => 7 ], + [ "G" => 9 ], + [ "H" => 9 ], + [ "I" => 4 ], + [ "J" => 5 ], + [ "K" => 8 ], + [ "L" => 6 ], + [ "M" => 12 ], + [ "N" => 10 ], + [ "O" => 10 ], + [ "P" => 8 ], + [ "Q" => 10 ], + [ "R" => 8 ], + [ "S" => 7 ], + [ "T" => 7 ], + [ "U" => 9 ], + [ "V" => 9 ], + [ "W" => 13 ], + [ "X" => 8 ], + [ "Y" => 7 ], + [ "Z" => 7 ], + [ "[" => 5 ], + [ "\\" => 6 ], + [ "]" => 5 ], + [ "^" => 7 ], + [ "_" => 7 ], + [ "`" => 4 ], + [ "a" => 7 ], + [ "b" => 8 ], + [ "c" => 6 ], + [ "d" => 8 ], + [ "e" => 8 ], + [ "f" => 5 ], + [ "g" => 7 ], + [ "h" => 8 ], + [ "i" => 4 ], + [ "j" => 4 ], + [ "k" => 7 ], + [ "l" => 4 ], + [ "m" => 12 ], + [ "n" => 8 ], + [ "o" => 8 ], + [ "p" => 8 ], + [ "q" => 8 ], + [ "r" => 5 ], + [ "s" => 6 ], + [ "t" => 5 ], + [ "u" => 8 ], + [ "v" => 7 ], + [ "w" => 11 ], + [ "x" => 7 ], + [ "y" => 7 ], + [ "z" => 6 ], + [ "{" => 5 ], + [ "|" => 7 ], + [ "}" => 5 ], + [ "~" => 7 ], + [ "é" => 8 ], + [ "éé" => 16 ], + [ "ABC" => 25 ], + [ "Hello" => 33 ], + [ "12345" => 35 ], + + +); + + +for my $test ( @tests ) { + my $string = $test->[0]; + my $expected = $test->[1]; + my $got = xl_string_pixel_width( $string ); + is( $got, $expected, "String = " . $string ); +} + + +__END__ diff -Nru libexcel-writer-xlsx-perl-1.10/t/worksheet/worksheet_encode_password.t libexcel-writer-xlsx-perl-1.11/t/worksheet/worksheet_encode_password.t --- libexcel-writer-xlsx-perl-1.10/t/worksheet/worksheet_encode_password.t 1970-01-01 00:00:00.000000000 +0000 +++ libexcel-writer-xlsx-perl-1.11/t/worksheet/worksheet_encode_password.t 2023-01-14 17:18:46.000000000 +0000 @@ -0,0 +1,68 @@ +############################################################################### +# +# Tests for Excel::Writer::XLSX::Worksheet methods. +# +# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org +# + +use lib 't/lib'; +use TestFunctions qw(_new_worksheet); +use strict; +use warnings; + +use Test::More tests => 29; + +############################################################################### +# +# Test the _encode_password() method. +# + +my $temp; +my $worksheet = _new_worksheet( \$temp ); + + +my @tests = ( + + [ "password", "83AF" ], + [ "This is a longer phrase", "D14E" ], + [ "0", "CE2A" ], + [ "01", "CEED" ], + [ "012", "CF7C" ], + [ "0123", "CC4B" ], + [ "01234", "CACA" ], + [ "012345", "C789" ], + [ "0123456", "DC88" ], + [ "01234567", "EB87" ], + [ "012345678", "9B86" ], + [ "0123456789", "FF84" ], + [ "01234567890", "FF86" ], + [ "012345678901", "EF87" ], + [ "0123456789012", "AF8A" ], + [ "01234567890123", "EF90" ], + [ "012345678901234", "EFA5" ], + [ "0123456789012345", "EFD0" ], + [ "01234567890123456", "EF09" ], + [ "012345678901234567", "EEB2" ], + [ "0123456789012345678", "ED33" ], + [ "01234567890123456789", "EA14" ], + [ "012345678901234567890", "E615" ], + [ "0123456789012345678901", "FE96" ], + [ "01234567890123456789012", "CC97" ], + [ "012345678901234567890123", "AA98" ], + [ "0123456789012345678901234", "FA98" ], + [ "01234567890123456789012345", "D298" ], + [ "0123456789012345678901234567890", "D2D3" ], +); + + +for my $test ( @tests ) { + my $password = $test->[0]; + my $expected = $test->[1]; + + my $got = $worksheet->_encode_password( $password ); + + is( $got, $expected, "Password = " . $password ); +} + + +__END__