From b4b720e5322df26689ccc684a78dcb5db924da94 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 25 May 2016 00:20:51 -0400 Subject: avoid calling first_child twice here --- lib/Spreadsheet/ParseXLSX.pm | 5 +++-- 1 file 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, ); -- cgit v1.2.3-54-g00ecf