diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-05-01 12:25:42 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-05-01 12:30:20 -0500 |
commit | 9cf7419380a812d1bbacb74018c111a7e77cb5ac (patch) | |
tree | 8bba295fd364c81a5f8cd0b30cbba483877d3adf /lib/Spreadsheet/Template/Generator/Parser/XLSX.pm | |
parent | 9824fd56633cc3cf4b65aa5c1585805e6fc447f3 (diff) | |
download | spreadsheet-template-9cf7419380a812d1bbacb74018c111a7e77cb5ac.tar.gz spreadsheet-template-9cf7419380a812d1bbacb74018c111a7e77cb5ac.zip |
handle types a bit better
Diffstat (limited to 'lib/Spreadsheet/Template/Generator/Parser/XLSX.pm')
-rw-r--r-- | lib/Spreadsheet/Template/Generator/Parser/XLSX.pm | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/Spreadsheet/Template/Generator/Parser/XLSX.pm b/lib/Spreadsheet/Template/Generator/Parser/XLSX.pm index 8e3c29c..75f8481 100644 --- a/lib/Spreadsheet/Template/Generator/Parser/XLSX.pm +++ b/lib/Spreadsheet/Template/Generator/Parser/XLSX.pm @@ -12,11 +12,19 @@ sub make_excel { return Spreadsheet::XLSX->new($filename); } +# XXX this stuff all feels like working around bugs in Spreadsheet::XLSX - +# maybe look into that at some point sub _filter_cell_contents { my $self = shift; - my ($contents) = @_; - # XXX this decode call really feels like a bug in Spreadsheet::XLSX - return XML::Entities::decode('all', $contents); + my ($contents, $type) = @_; + + $contents = XML::Entities::decode('all', $contents); + + if ($type eq 'number') { + $contents = 0+$contents; + } + + return $contents; } __PACKAGE__->meta->make_immutable; |