From 70e0ccd7243ee9448a36118d70e4441fab267315 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 9 Sep 2013 10:18:29 -0400 Subject: fix string lookups when cells have complicated formatting (#6) if a cell has multiple different formats, this shows up as multiple different rich text parts in the shared string table, so make sure to only count each shared string table entry once --- lib/Spreadsheet/ParseXLSX.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/Spreadsheet') diff --git a/lib/Spreadsheet/ParseXLSX.pm b/lib/Spreadsheet/ParseXLSX.pm index 1aa14eb..6efc3b8 100644 --- a/lib/Spreadsheet/ParseXLSX.pm +++ b/lib/Spreadsheet/ParseXLSX.pm @@ -238,8 +238,11 @@ sub _parse_shared_strings { return [ map { - { Text => $_->text } # XXX are Unicode, Rich, or Ext important? - } $strings->find_nodes('//t') + my $node = $_; + # XXX this discards information about formatting within cells + # not sure how to represent that + { Text => join('', map { $_->text } $node->find_nodes('t')) } + } $strings->find_nodes('//si') ]; } -- cgit v1.2.3-54-g00ecf