Subject: | column calculation fails for columns > "AA" |
When processing columns > "AA" the columncount should continue at 26.
$col *= 26 is too simple.
See attached patch.
patch -p 0 < patch.txt
Note this is a combined patch, which also fixes the incorrect worksheet
mapping.
The sheetId of a worksheet is fixed. It can change when worksheets are
deleted or moved. The corellation should be done via the r:id attribute.
Subject: | patch.txt |
diff -r -u Spreadsheet-XLSX-0.02/lib/Spreadsheet/XLSX.pm new/Spreadsheet-XLSX-0.02/lib/Spreadsheet/XLSX.pm
--- Spreadsheet-XLSX-0.02/lib/Spreadsheet/XLSX.pm 2008-05-12 08:59:23.000000000 +0200
+++ new/Spreadsheet-XLSX-0.02/lib/Spreadsheet/XLSX.pm 2008-05-19 21:02:35.187500000 +0200
@@ -59,16 +59,16 @@
MinCol => 1000000,
};
- foreach ($other =~ /(\w+\=\".*?\")/gsm) {
+ foreach ($other =~ /(\S+=".*?")/gsm) {
- my ($k, $v) = split /\=?\"/;
+ my ($k, $v) = split /=?"/;
if ($k eq 'name') {
$sheet -> {Name} = $v;
$sheet -> {Name} = $converter -> convert ($sheet -> {Name}) if $converter;
}
- elsif ($k eq 'sheetId') {
- $sheet -> {Id} = $v
+ elsif ($k eq 'r:id') {
+ ($sheet -> {Id}) = $v =~ m{rId(\d+)};
};
}
@@ -96,7 +96,8 @@
$col = ord ($1) - 65;
- if ($2) {
+ if ($2) {
+ $col++;
$col *= 26;
$col += (ord ($2) - 65);
}
@@ -250,4 +251,4 @@
it under the same terms as Perl itself, either Perl version 5.8.8 or,
at your option, any later version of Perl 5 you may have available.
-=cut
\ No newline at end of file
+=cut
Only in new/Spreadsheet-XLSX-0.02: test.pl