summaryrefslogtreecommitdiffstats
path: root/lib/Spreadsheet/ParseXLSX.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-07-31 13:37:36 -0400
committerJesse Luehrs <doy@tozt.net>2013-07-31 13:37:36 -0400
commitd89c1a7f87569f4029e5f26335d3dc8bcebd15da (patch)
treeb69280a95d6d0ccace3ccc58cc451d5c021af28d /lib/Spreadsheet/ParseXLSX.pm
parent4fb85f2dd172445851fee5ea17d450d65f10953f (diff)
downloadspreadsheet-parsexlsx-d89c1a7f87569f4029e5f26335d3dc8bcebd15da.tar.gz
spreadsheet-parsexlsx-d89c1a7f87569f4029e5f26335d3dc8bcebd15da.zip
fix the row translation formula (fixes #4)
Diffstat (limited to 'lib/Spreadsheet/ParseXLSX.pm')
-rw-r--r--lib/Spreadsheet/ParseXLSX.pm11
1 files changed, 7 insertions, 4 deletions
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 {