summaryrefslogtreecommitdiffstats
path: root/lib/Spreadsheet/ParseXLSX.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Spreadsheet/ParseXLSX.pm')
-rw-r--r--lib/Spreadsheet/ParseXLSX.pm8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Spreadsheet/ParseXLSX.pm b/lib/Spreadsheet/ParseXLSX.pm
index a66c4d8..6cf5486 100644
--- a/lib/Spreadsheet/ParseXLSX.pm
+++ b/lib/Spreadsheet/ParseXLSX.pm
@@ -202,7 +202,7 @@ sub _parse_sheet {
$sheet->{MaxCol} = -1;
$sheet->{Selection} = [ 0, 0 ];
- my @merged_cells;
+ my %merged_cells;
my @column_formats;
my @column_widths;
@@ -288,7 +288,7 @@ sub _parse_sheet {
];
for my $row ($toprow .. $bottomrow) {
for my $col ($leftcol .. $rightcol) {
- push(@merged_cells, [$row, $col]);
+ $merged_cells{"$row;$col"} = 1;
}
}
}
@@ -417,9 +417,7 @@ sub _parse_sheet {
my $format_idx = $cell->att('s') || 0;
my $format = $sheet->{_Book}{Format}[$format_idx];
die "unknown format $format_idx" unless $format;
- $format->{Merged} = !!grep {
- $row == $_->[0] && $col == $_->[1]
- } @merged_cells;
+ $format->{Merged} = $merged_cells{"$row;$col"};
# see the list of built-in formats below in _parse_styles
# XXX probably should figure this out from the actual format string,