diff options
author | Jesse Luehrs <doy@tozt.net> | 2016-05-25 00:20:51 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2016-05-25 00:20:51 -0400 |
commit | b4b720e5322df26689ccc684a78dcb5db924da94 (patch) | |
tree | 9fcf12b8fbdff8df3f834e4f4e3cebfb16831c6d | |
parent | efac4c2315118e4e8b0f783d41b4fdb6e0255440 (diff) | |
download | spreadsheet-parsexlsx-b4b720e5322df26689ccc684a78dcb5db924da94.tar.gz spreadsheet-parsexlsx-b4b720e5322df26689ccc684a78dcb5db924da94.zip |
avoid calling first_child twice here
-rw-r--r-- | lib/Spreadsheet/ParseXLSX.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Spreadsheet/ParseXLSX.pm b/lib/Spreadsheet/ParseXLSX.pm index bea6b98..a66c4d8 100644 --- a/lib/Spreadsheet/ParseXLSX.pm +++ b/lib/Spreadsheet/ParseXLSX.pm @@ -428,14 +428,15 @@ sub _parse_sheet { $long_type = 'Date'; } + my $formula = $cell->first_child('s:f'); my $cell = Spreadsheet::ParseExcel::Cell->new( Val => $val, Type => $long_type, Merged => $format->{Merged}, Format => $format, FormatNo => $format_idx, - ($cell->first_child('s:f') - ? (Formula => $cell->first_child('s:f')->text) + ($formula + ? (Formula => $formula->text) : ()), Rich => $Rich, ); |