From d89c1a7f87569f4029e5f26335d3dc8bcebd15da Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 31 Jul 2013 13:37:36 -0400 Subject: fix the row translation formula (fixes #4) --- lib/Spreadsheet/ParseXLSX.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/Spreadsheet/ParseXLSX.pm') diff --git a/lib/Spreadsheet/ParseXLSX.pm b/lib/Spreadsheet/ParseXLSX.pm index 6d2f232..fa26e42 100644 --- a/lib/Spreadsheet/ParseXLSX.pm +++ b/lib/Spreadsheet/ParseXLSX.pm @@ -574,11 +574,14 @@ sub _cell_to_row_col { my ($cell) = @_; my ($col, $row) = $cell =~ /([A-Z]+)([0-9]+)/; - $col =~ tr/A-Z/0-9A-P/; - $col = POSIX::strtol($col, 26); - $row = $row - 1; - return ($row, $col); + (my $ncol = $col) =~ tr/A-Z/1-9A-Q/; + $ncol = POSIX::strtol($ncol, 27); + $ncol -= 1; + + my $nrow = $row - 1; + + return ($nrow, $ncol); } sub _color { -- cgit v1.2.3-54-g00ecf