diff options
author | Jesse Luehrs <doy@tozt.net> | 2015-03-15 01:14:11 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2015-03-15 01:14:11 -0400 |
commit | f32d2416c228eeafedcd7d77178c74efdc7e3884 (patch) | |
tree | f0a6fc65184de82162e9f96efbc8b8a310075fe3 | |
parent | f0e814f4120bde95fe38e271114c49b07ae10b2e (diff) | |
download | spreadsheet-parsexlsx-f32d2416c228eeafedcd7d77178c74efdc7e3884.tar.gz spreadsheet-parsexlsx-f32d2416c228eeafedcd7d77178c74efdc7e3884.zip |
cleanups
-rw-r--r-- | lib/Spreadsheet/ParseXLSX.pm | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lib/Spreadsheet/ParseXLSX.pm b/lib/Spreadsheet/ParseXLSX.pm index 615835e..26269fd 100644 --- a/lib/Spreadsheet/ParseXLSX.pm +++ b/lib/Spreadsheet/ParseXLSX.pm @@ -255,21 +255,17 @@ sub _parse_sheet { for my $cell ( $row_elt->children('c') ){ my ($row, $col) = $self->_cell_to_row_col($cell->att('r')); - if ($sheet->{MaxRow} < $row) { - $sheet->{MaxRow} = $row; - } - if ($sheet->{MaxCol} < $col) { - $sheet->{MaxCol} = $col; - } + $sheet->{MaxRow} = $row + if $sheet->{MaxRow} < $row; + $sheet->{MaxCol} = $col + if $sheet->{MaxCol} < $col; my $type = $cell->att('t') || 'n'; my $val_xml; if ($type ne 'inlineStr') { - $val_xml = $cell->first_child('v'); - } elsif (defined $cell->first_child('is')) { - foreach my $tnode ($cell->find_nodes ('.//t')) { - $val_xml = $tnode; - last; - } + $val_xml = $cell->first_child('v'); + } + elsif (defined $cell->first_child('is')) { + $val_xml = ($cell->find_nodes('.//t'))[0]; } my $val = $val_xml ? $val_xml->text : undef; @@ -783,7 +779,10 @@ sub _color { elsif (defined $color_node->att('theme')) { my $theme = $colors->[$color_node->att('theme')]; if (defined $theme) { - $color = '#' . $colors->[$color_node->att('theme')]; + $color = "#$theme"; + } + else { + return; } } |