Skip Menu |

This queue is for tickets about the Spreadsheet-XLSX CPAN distribution.

Report information
The Basics
Id: 36013
Status: resolved
Priority: 0/
Queue: Spreadsheet-XLSX

People
Owner: Nobody in particular
Requestors: joerg [...] joergmeltzer.de
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.02
Fixed in: (no value)



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
Subject: applied
Thanks a lot for the patch. It's in version 0.03.