summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-07-16 17:11:13 -0400
committerJesse Luehrs <doy@tozt.net>2013-07-16 17:11:13 -0400
commit5e4cba47bafba988183e6b1b21cd69202e39dfe2 (patch)
treeebec46fb1c5facc6bffebe30e9589e481a865d7c
parentdb118f881d359a136f427e1c64be15f8a709b5dc (diff)
downloadspreadsheet-parsexlsx-5e4cba47bafba988183e6b1b21cd69202e39dfe2.tar.gz
spreadsheet-parsexlsx-5e4cba47bafba988183e6b1b21cd69202e39dfe2.zip
make sure $cell->value works
-rw-r--r--lib/Spreadsheet/ParseXLSX.pm16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/Spreadsheet/ParseXLSX.pm b/lib/Spreadsheet/ParseXLSX.pm
index 263de2c..2462f54 100644
--- a/lib/Spreadsheet/ParseXLSX.pm
+++ b/lib/Spreadsheet/ParseXLSX.pm
@@ -162,7 +162,8 @@ sub _parse_sheet {
die "unimplemented type $type"; # XXX
}
- my $format = $sheet->{_Book}{Format}[$cell->att('s') || 0];
+ my $format_idx = $cell->att('s') || 0;
+ my $format = $sheet->{_Book}{Format}[$format_idx];
# see the list of built-in formats below in _parse_styles
# XXX probably should figure this out from the actual format string,
@@ -171,14 +172,19 @@ sub _parse_sheet {
$long_type = 'Date';
}
- $sheet->{Cells}[$row][$col] = Spreadsheet::ParseExcel::Cell->new(
- Val => $val,
- Type => $long_type,
- Format => $format,
+ my $cell = Spreadsheet::ParseExcel::Cell->new(
+ Val => $val,
+ Type => $long_type,
+ Format => $format,
+ FormatNo => $format_idx,
($cell->first_child('f')
? (Formula => $cell->first_child('f')->text)
: ()),
);
+ $cell->{_Value} = $sheet->{_Book}{FmtClass}->ValFmt(
+ $cell, $sheet->{_Book}
+ );
+ $sheet->{Cells}[$row][$col] = $cell;
}
my @column_widths;