r29301 - in /branches/upstream/libspreadsheet-read-perl/current: Changes MANIFEST META.yml README Read.pm examples/ss2tk examples/xls2csv examples/xlscat files/perc.xls t/35_perc.t
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Mon Jan 5 13:45:22 UTC 2009
Author: gregoa
Date: Mon Jan 5 13:45:19 2009
New Revision: 29301
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=29301
Log:
[svn-upgrade] Integrating new upstream version, libspreadsheet-read-perl (0.31)
Added:
branches/upstream/libspreadsheet-read-perl/current/files/perc.xls (with props)
branches/upstream/libspreadsheet-read-perl/current/t/35_perc.t
Modified:
branches/upstream/libspreadsheet-read-perl/current/Changes
branches/upstream/libspreadsheet-read-perl/current/MANIFEST
branches/upstream/libspreadsheet-read-perl/current/META.yml
branches/upstream/libspreadsheet-read-perl/current/README
branches/upstream/libspreadsheet-read-perl/current/Read.pm
branches/upstream/libspreadsheet-read-perl/current/examples/ss2tk
branches/upstream/libspreadsheet-read-perl/current/examples/xls2csv
branches/upstream/libspreadsheet-read-perl/current/examples/xlscat
Modified: branches/upstream/libspreadsheet-read-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libspreadsheet-read-perl/current/Changes?rev=29301&op=diff
==============================================================================
--- branches/upstream/libspreadsheet-read-perl/current/Changes (original)
+++ branches/upstream/libspreadsheet-read-perl/current/Changes Mon Jan 5 13:45:19 2009
@@ -1,4 +1,10 @@
Revision history for Spreadsheet::Read
+
+0.31 Sun 04 Jan 2009
+
+ - Upped Copyright notices to 2009
+ - Detection of percentage type
+ - Even more reliable detection of Date types
0.30 Mon 22 Dec 2008
Modified: branches/upstream/libspreadsheet-read-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libspreadsheet-read-perl/current/MANIFEST?rev=29301&op=diff
==============================================================================
--- branches/upstream/libspreadsheet-read-perl/current/MANIFEST (original)
+++ branches/upstream/libspreadsheet-read-perl/current/MANIFEST Mon Jan 5 13:45:19 2009
@@ -14,6 +14,7 @@
files/macosx.csv
files/macosx.xls
files/misc.xls
+files/perc.xls
files/test.csv
files/test_m.csv
files/test.ods
@@ -39,6 +40,7 @@
t/33_misc.t
t/32_fmt.t
t/34_dates.t
+t/35_perc.t
t/40_sxc.t
t/45_ods.t
t/46_clr.t
Modified: branches/upstream/libspreadsheet-read-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libspreadsheet-read-perl/current/META.yml?rev=29301&op=diff
==============================================================================
--- branches/upstream/libspreadsheet-read-perl/current/META.yml (original)
+++ branches/upstream/libspreadsheet-read-perl/current/META.yml Mon Jan 5 13:45:19 2009
@@ -1,6 +1,6 @@
--- #YAML:1.1
name: Read
-version: 0.30
+version: 0.31
abstract: Meta-Wrapper for reading spreadsheet data
license: perl
author:
@@ -10,7 +10,7 @@
provides:
Spreadsheet::Read:
file: Read.pm
- version: 0.30
+ version: 0.31
requires:
perl: 5.006
Exporter: 0
Modified: branches/upstream/libspreadsheet-read-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libspreadsheet-read-perl/current/README?rev=29301&op=diff
==============================================================================
--- branches/upstream/libspreadsheet-read-perl/current/README (original)
+++ branches/upstream/libspreadsheet-read-perl/current/README Mon Jan 5 13:45:19 2009
@@ -50,7 +50,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2005-2008 H.Merijn Brand
+Copyright (C) 2005-2009 H.Merijn Brand
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
Modified: branches/upstream/libspreadsheet-read-perl/current/Read.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libspreadsheet-read-perl/current/Read.pm?rev=29301&op=diff
==============================================================================
--- branches/upstream/libspreadsheet-read-perl/current/Read.pm (original)
+++ branches/upstream/libspreadsheet-read-perl/current/Read.pm Mon Jan 5 13:45:19 2009
@@ -21,7 +21,7 @@
use strict;
use warnings;
-our $VERSION = "0.30";
+our $VERSION = "0.31";
sub Version { $VERSION }
use Carp;
@@ -358,12 +358,22 @@
my $fmt = $FmT->{FmtIdx}
? $oBook->{FormatStr}{$FmT->{FmtIdx}}
: undef;
- if (defined $fmt) {
+ if ($oWkC->{Type} eq "Numeric") {
# Fixed in 0.33 and up
- $oWkC->{Type} eq "Numeric" && $fmt =~ m{^[dmy][-\\/dmy]*$} and
+ # see Spreadsheet/ParseExcel/FmtDefault.pm
+ $FmT->{FmtIdx} == 0x0e ||
+ $FmT->{FmtIdx} == 0x0f ||
+ $FmT->{FmtIdx} == 0x10 ||
+ $FmT->{FmtIdx} == 0x11 ||
+ $FmT->{FmtIdx} == 0x16 ||
+ (defined $fmt && $fmt =~ m{^[dmy][-\\/dmy]*$}) and
$oWkC->{Type} = "Date";
- $fmt =~ s/\\//g;
+ $FmT->{FmtIdx} == 0x09 ||
+ $FmT->{FmtIdx} == 0x0a ||
+ (defined $fmt && $fmt =~ m{^0+\.0+%$}) and
+ $oWkC->{Type} = "Percentage";
}
+ defined $fmt and $fmt =~ s/\\//g;
$opt{cells} and # Formatted value
$sheet{$cell} = exists $def_fmt{$FmT->{FmtIdx}}
? $oFmt->ValFmt ($oWkC, $oBook)
@@ -876,7 +886,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2005-2008 H.Merijn Brand
+Copyright (C) 2005-2009 H.Merijn Brand
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
Modified: branches/upstream/libspreadsheet-read-perl/current/examples/ss2tk
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libspreadsheet-read-perl/current/examples/ss2tk?rev=29301&op=diff
==============================================================================
--- branches/upstream/libspreadsheet-read-perl/current/examples/ss2tk (original)
+++ branches/upstream/libspreadsheet-read-perl/current/examples/ss2tk Mon Jan 5 13:45:19 2009
@@ -1,7 +1,7 @@
#!/pro/bin/perl
# ss2tk: show SpreadSheet file in Tk::TableMatrix::Spreadsheet (*)
-# (m)'07 [26-06-2007] Copyright H.M.Brand 2005-2008
+# (m)'07 [26-06-2007] Copyright H.M.Brand 2005-2009
use strict;
use warnings;
Modified: branches/upstream/libspreadsheet-read-perl/current/examples/xls2csv
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libspreadsheet-read-perl/current/examples/xls2csv?rev=29301&op=diff
==============================================================================
--- branches/upstream/libspreadsheet-read-perl/current/examples/xls2csv (original)
+++ branches/upstream/libspreadsheet-read-perl/current/examples/xls2csv Mon Jan 5 13:45:19 2009
@@ -1,7 +1,7 @@
#!/pro/bin/perl
# xls2csv: Convert Microsoft Excel spreadsheet to CSV
-# (m)'08 [10-03-2008] Copyright H.M.Brand 2008-2008
+# (m)'08 [10-03-2008] Copyright H.M.Brand 2008-2009
use strict;
use warnings;
Modified: branches/upstream/libspreadsheet-read-perl/current/examples/xlscat
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libspreadsheet-read-perl/current/examples/xlscat?rev=29301&op=diff
==============================================================================
--- branches/upstream/libspreadsheet-read-perl/current/examples/xlscat (original)
+++ branches/upstream/libspreadsheet-read-perl/current/examples/xlscat Mon Jan 5 13:45:19 2009
@@ -1,7 +1,7 @@
#!/pro/bin/perl
# xls2cat: show XLS/SXC file as Text
-# (m)'08 [10-10-2008] Copyright H.M.Brand 2005-2008
+# (m)'08 [10-10-2008] Copyright H.M.Brand 2005-2009
use strict;
use warnings;
Added: branches/upstream/libspreadsheet-read-perl/current/files/perc.xls
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libspreadsheet-read-perl/current/files/perc.xls?rev=29301&op=file
==============================================================================
Binary file - no diff available.
Propchange: branches/upstream/libspreadsheet-read-perl/current/files/perc.xls
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: branches/upstream/libspreadsheet-read-perl/current/t/35_perc.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libspreadsheet-read-perl/current/t/35_perc.t?rev=29301&op=file
==============================================================================
--- branches/upstream/libspreadsheet-read-perl/current/t/35_perc.t (added)
+++ branches/upstream/libspreadsheet-read-perl/current/t/35_perc.t Mon Jan 5 13:45:19 2009
@@ -1,0 +1,29 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use Spreadsheet::Read;
+if (Spreadsheet::Read::parses ("xls")) {
+ plan tests => 77;
+ }
+else {
+ plan skip_all => "No M\$-Excel parser found";
+ }
+
+my $xls;
+ok ($xls = ReadData ("files/perc.xls", attr => 1), "Excel Percentage testcase");
+
+my $ss = $xls->[1];
+my $attr = $ss->{attr};
+
+foreach my $row (1 .. 19) {
+ is ($ss->{attr}[1][$row]{type}, "numeric", "Type A$row numeric");
+ is ($ss->{attr}[2][$row]{type}, "percentage", "Type B$row percentage");
+ is ($ss->{attr}[3][$row]{type}, "percentage", "Type C$row percentage");
+
+ my $i = int $ss->{"A$row"};
+ is ("$i%", $ss->{"B$row"}, "Formatted values for row $row\n");
+ }
More information about the Pkg-perl-cvs-commits
mailing list