summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-07-26 03:28:47 -0400
committerJesse Luehrs <doy@tozt.net>2013-07-26 03:30:27 -0400
commit2734293556482250c43add75ec9fb53e751ee438 (patch)
treec3454984ab6cc4362492c12e5920a979e07501a1
parent6b269b2f2d10e29d873ca5861bb0f78933c5aac9 (diff)
downloadspreadsheet-parsexlsx-2734293556482250c43add75ec9fb53e751ee438.tar.gz
spreadsheet-parsexlsx-2734293556482250c43add75ec9fb53e751ee438.zip
some xlsx generators don't set the 'selection' node (fixes #1)
-rw-r--r--lib/Spreadsheet/ParseXLSX.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Spreadsheet/ParseXLSX.pm b/lib/Spreadsheet/ParseXLSX.pm
index 410a45d..d96d275 100644
--- a/lib/Spreadsheet/ParseXLSX.pm
+++ b/lib/Spreadsheet/ParseXLSX.pm
@@ -214,9 +214,13 @@ sub _parse_sheet {
];
my ($selection) = $sheet_xml->find_nodes('//selection');
- my $cell = $selection->att('activeCell');
-
- $sheet->{Selection} = [ $self->_cell_to_row_col($cell) ];
+ if ($selection) {
+ my $cell = $selection->att('activeCell');
+ $sheet->{Selection} = [ $self->_cell_to_row_col($cell) ];
+ }
+ else {
+ $sheet->{Selection} = [ 0, 0 ];
+ }
}
sub _parse_shared_strings {