summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-07-05 14:35:08 -0400
committerJesse Luehrs <doy@tozt.net>2014-07-05 14:35:08 -0400
commit01f97f6374de81f99aaecdf593615a9d334781da (patch)
treea96a907e4a013a9d90168b732ef8a102f3c3123a /lib
parent063a3ed5650df0e84af5ddfc3c909077d04159d5 (diff)
parentc4c84e8055f67738d0f9b6ae30d1d844c6fc46a4 (diff)
downloadspreadsheet-parsexlsx-01f97f6374de81f99aaecdf593615a9d334781da.tar.gz
spreadsheet-parsexlsx-01f97f6374de81f99aaecdf593615a9d334781da.zip
Merge pull request #26 from felliott/parseexcel-parity
Add TabColor and ColFmtNo support to ParseXLSX
Diffstat (limited to 'lib')
-rw-r--r--lib/Spreadsheet/ParseXLSX.pm16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Spreadsheet/ParseXLSX.pm b/lib/Spreadsheet/ParseXLSX.pm
index 99d3c33..264ead6 100644
--- a/lib/Spreadsheet/ParseXLSX.pm
+++ b/lib/Spreadsheet/ParseXLSX.pm
@@ -137,6 +137,7 @@ sub _parse_sheet {
my @merged_cells;
+ my @column_formats;
my @column_widths;
my @row_heights;
@@ -196,8 +197,10 @@ sub _parse_sheet {
'col' => sub {
my ( $twig, $col ) = @_;
- $column_widths[ $_ - 1 ] = $col->att('width')
- for ( $col->att('min') .. $col->att('max') );
+ for my $colnum ($col->att('min')..$col->att('max')) {
+ $column_widths[$colnum - 1] = $col->att('width');
+ $column_formats[$colnum - 1] = $col->att('style');
+ }
$twig->purge;
},
@@ -227,6 +230,14 @@ sub _parse_sheet {
$twig->purge;
},
+ 'sheetPr/tabColor' => sub {
+ my ( $twig, $tab_color ) = @_;
+
+ $sheet->{TabColor} = $self->_color($sheet->{_Book}{Color}, $tab_color);
+
+ $twig->purge;
+ },
+
}
);
@@ -327,6 +338,7 @@ sub _parse_sheet {
$sheet->{ColWidth} = [
map { defined $_ ? 0+$_ : 0+$default_column_width } @column_widths
];
+ $sheet->{ColFmtNo} = \@column_formats;
}