From: Rob Kinyon Date: Wed, 23 Feb 2005 21:02:47 +0000 (+0000) Subject: Intermediate commit X-Git-Tag: v0.21~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9d17242532bd6fb87d579fa24cc213b265b98e82;p=p5sagit%2FExcel-Template.git Intermediate commit --- diff --git a/Changes b/Changes index acd1678..a685b08 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,13 @@ Revision history for Perl distribution Excel::Template -0.20 Wed Jan 26 12:00:00 2004 +0.21 Wed Feb 24 14:00:00 2005 + - Fixed documentation bug in BACKREF (Thanks to Paul Williams) + - Added code to Makefile.PL to skip .swp files in the Makefile + - Added RENDERER option to new() + - Deprecated BIG_FILE + - Added pod.t and pod_coverage.t + +0.20 Wed Jan 26 12:00:00 2005 - Removed PM_FILTER by adding an optional USE_UNICODE runtime parameter. - Added a "type" attribute to CELL to allow printing by the write_*() family diff --git a/MANIFEST b/MANIFEST index 3b1983c..7e46b15 100644 --- a/MANIFEST +++ b/MANIFEST @@ -61,8 +61,14 @@ t/014_heightwidth.t t/014.xml t/015_cell_type.t t/015.xml +t/016_renderers.t +t/016.xml +t/pod.t +t/pod_coverage.t t/mock.pm t/Spreadsheet/WriteExcel.pm +t/Spreadsheet/WriteExcelXML.pm t/Spreadsheet/WriteExcel/Worksheet.pm +t/Spreadsheet/WriteExcel/Big.pm Makefile.PL META.yml Module meta-data (added by MakeMaker) diff --git a/Makefile.PL b/Makefile.PL index fa70b36..db972f0 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,8 +1,16 @@ +use strict; + use ExtUtils::MakeMaker; -# See lib/ExtUtils/MakeMaker.pm for details of how to influence -# the contents of the Makefile that is written. +{ + no strict 'refs'; -use strict; + my $libscan = \&{"ExtUtils::MM_Any::libscan"}; + *{"ExtUtils::MM_Any::libscan"} = sub { + return '' unless $libscan->(@_); + return '' if $_[1] =~ /\.swp$/; + return $_[1]; + }; +} my $prereqs = { 'Spreadsheet::WriteExcel' => 0.42, @@ -27,7 +35,9 @@ if ($] < 5.008) WriteMakefile( NAME => 'Excel::Template', VERSION_FROM => 'lib/Excel/Template.pm', # finds $VERSION - AUTHOR => 'Rob Kinyon (rob.kinyon@gmail.com)', ABSTRACT => 'Excel::Template', PREREQ_PM => $prereqs, + ($] >= 5.005 ? + (ABSTRACT_FROM => 'lib/Excel/Template.pm', + AUTHOR => 'Rob Kinyon (rob.kinyon@gmail.com)') : ()), ); diff --git a/lib/Excel/Template.pm b/lib/Excel/Template.pm index 8eff016..d157cdb 100644 --- a/lib/Excel/Template.pm +++ b/lib/Excel/Template.pm @@ -28,6 +28,11 @@ sub new unshift @renderer_classes, 'Spreadsheet::WriteExcel::Big'; } + if (exists $self->{XML} && $self->{XML}) + { + unshift @renderer_classes, 'Spreadsheet::WriteExcelXML'; + } + $self->{RENDERER} = undef; foreach my $class (@renderer_classes) { @@ -220,7 +225,7 @@ For example, test.xml: Now, create a small program to use it: #!/usr/bin/perl -w - use Excel::Template + use Excel::Template; # Create the Excel template my $template = Excel::Template->new( @@ -272,7 +277,7 @@ described below.) new() accepts an optional BIG_FILE parameter. This will attempt to change the renderer from L to L. You -must already have L installed on your system. +must already have L (required by Spreadsheet::WriteExcel::Big) installed on your system. new() also accepts an optional USE_UNICODE parameter. This will use L to represent strings instead of Perl's internal string @@ -281,8 +286,9 @@ handling. You must already have L installed on your system. The USE_UNICODE parameter will be ignored if you are using Perl 5.8 or higher as Perl's internal string handling is unicode-aware. -NOTE: L and mod_perl clash for some reason. This -is outside of my control. +NOTE: Certain older versions of L and mod_perl clash for some +reason. Upgrading to the latest version of L should fix the +problem. =head2 param() diff --git a/lib/Excel/Template/Element/Backref.pm b/lib/Excel/Template/Element/Backref.pm index 4c5691c..0c34f90 100755 --- a/lib/Excel/Template/Element/Backref.pm +++ b/lib/Excel/Template/Element/Backref.pm @@ -73,7 +73,7 @@ In the example... - =+ + =+ The formula in row 2 would be =A1+C1. C1 is the last to reference "that_cell". diff --git a/t/Spreadsheet/WriteExcel.pm b/t/Spreadsheet/WriteExcel.pm index 1682f2c..31d8448 100644 --- a/t/Spreadsheet/WriteExcel.pm +++ b/t/Spreadsheet/WriteExcel.pm @@ -11,37 +11,37 @@ sub new { { local $" = "', '"; - push @mock::calls, __PACKAGE__ . "::new( '@_' )"; + push @mock::calls, ref($self) . "::new( '@_' )"; } return $self; } sub close { - shift; + my $self = shift; { local $" = "', '"; - push @mock::calls, __PACKAGE__ . "::close( '@_' )"; + push @mock::calls, ref($self) . "::close( '@_' )"; } } sub add_worksheet { - shift; + my $self = shift; { local $" = "', '"; - push @mock::calls, __PACKAGE__ . "::add_worksheet( '@_' )"; + push @mock::calls, ref($self) . "::add_worksheet( '@_' )"; } return Spreadsheet::WriteExcel::Worksheet->new; } my $format_num = 1; sub add_format { - shift; + my $self = shift; my %x = @_; my @x = map { $_ => $x{$_} } sort keys %x; { local $" = "', '"; - push @mock::calls, __PACKAGE__ . "::add_format( '@x' )"; + push @mock::calls, ref($self) . "::add_format( '@x' )"; } return $format_num++; }