From 4e03d41c19ee0f70f076934455844fe40b122f3f Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 29 Aug 2013 15:41:59 -0400 Subject: fix this algorithm again --- lib/Spreadsheet/ParseXLSX.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/Spreadsheet/ParseXLSX.pm') diff --git a/lib/Spreadsheet/ParseXLSX.pm b/lib/Spreadsheet/ParseXLSX.pm index 8159fa8..209ae6f 100644 --- a/lib/Spreadsheet/ParseXLSX.pm +++ b/lib/Spreadsheet/ParseXLSX.pm @@ -575,9 +575,12 @@ sub _cell_to_row_col { my ($col, $row) = $cell =~ /([A-Z]+)([0-9]+)/; - (my $ncol = $col) =~ tr/A-Z/1-9A-Q/; - $ncol = POSIX::strtol($ncol, 27); - $ncol -= 1; + my $ncol = 0; + for my $char (split //, $col) { + $ncol *= 26; + $ncol += ord($char) - ord('A') + 1; + } + $ncol = $ncol - 1; my $nrow = $row - 1; -- cgit v1.2.3-54-g00ecf