summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-05-24 23:51:59 -0400
committerJesse Luehrs <doy@tozt.net>2016-05-24 23:54:56 -0400
commitefac4c2315118e4e8b0f783d41b4fdb6e0255440 (patch)
tree8719ae3001bb72b7b13f3c0c273c6d29dbd29043
parent4071d6ab97ef6e85fed3c19a363fc02d7ae855ac (diff)
downloadspreadsheet-parsexlsx-efac4c2315118e4e8b0f783d41b4fdb6e0255440.tar.gz
spreadsheet-parsexlsx-efac4c2315118e4e8b0f783d41b4fdb6e0255440.zip
apparently i don't really understand how the apply* attributes work
but actually suppressing their associated styles is apparently wrong
-rw-r--r--lib/Spreadsheet/ParseXLSX.pm29
1 files changed, 11 insertions, 18 deletions
diff --git a/lib/Spreadsheet/ParseXLSX.pm b/lib/Spreadsheet/ParseXLSX.pm
index 7a9594a..bea6b98 100644
--- a/lib/Spreadsheet/ParseXLSX.pm
+++ b/lib/Spreadsheet/ParseXLSX.pm
@@ -868,18 +868,15 @@ sub _parse_styles {
%ignore,
);
- if (!$ignore{IgnoreFont}) {
- $opts{FontNo} = 0+$xml_fmt->att('fontId');
- }
- if (!$ignore{IgnoreFill}) {
- $opts{Fill} = $fills[$xml_fmt->att('fillId')];
- }
- if (!$ignore{IgnoreBorder}) {
- $opts{BdrStyle} = $borders[$xml_fmt->att('borderId')]{styles};
- $opts{BdrColor} = $borders[$xml_fmt->att('borderId')]{colors};
- $opts{BdrDiag} = $borders[$xml_fmt->att('borderId')]{diagonal};
- }
- if (!$ignore{IgnoreAlignment} && $alignment) {
+ $opts{FmtIdx} = 0+($xml_fmt->att('numFmtId')||0);
+ $opts{FontNo} = 0+($xml_fmt->att('fontId')||0);
+ $opts{Font} = $font[$opts{FontNo}];
+ $opts{Fill} = $fills[$xml_fmt->att('fillId')||0];
+ $opts{BdrStyle} = $borders[$xml_fmt->att('borderId')||0]{styles};
+ $opts{BdrColor} = $borders[$xml_fmt->att('borderId')||0]{colors};
+ $opts{BdrDiag} = $borders[$xml_fmt->att('borderId')||0]{diagonal};
+
+ if ($alignment) {
$opts{AlignH} = $halign{$alignment->att('horizontal') || 'general'};
$opts{Wrap} = $self->_xml_boolean($alignment->att('wrapText'));
$opts{AlignV} = $valign{$alignment->att('vertical') || 'bottom'};
@@ -888,18 +885,14 @@ sub _parse_styles {
$opts{Shrink} = $self->_xml_boolean($alignment->att('shrinkToFit'));
# JustLast => $iJustL,
}
- if (!$ignore{IgnoreNumberFormat}) {
- $opts{FmtIdx} = 0+$xml_fmt->att('numFmtId');
- }
- if (!$ignore{IgnoreProtection} && $protection) {
+
+ if ($protection) {
$opts{Lock} = defined $protection->att('locked')
? $self->_xml_boolean($protection->att('locked'))
: 1;
$opts{Hidden} = $self->_xml_boolean($protection->att('hidden'));
}
- $opts{Font} = $font[$opts{FontNo}];
-
# Style => $iStyle,
# Key123 => $i123,
# Merge => $iMerge,