diff --git a/components/fpspreadsheet/examples/spready/spready.lpi b/components/fpspreadsheet/examples/spready/spready.lpi index 55aa499e8..28c472d11 100644 --- a/components/fpspreadsheet/examples/spready/spready.lpi +++ b/components/fpspreadsheet/examples/spready/spready.lpi @@ -15,8 +15,67 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/fpspreadsheet/xlsxooxml.pas b/components/fpspreadsheet/xlsxooxml.pas index f28c8efa3..f5380b814 100755 --- a/components/fpspreadsheet/xlsxooxml.pas +++ b/components/fpspreadsheet/xlsxooxml.pas @@ -721,24 +721,26 @@ begin if nodeName = 'xf' then begin xf := TXfListData.Create; + // strange: sometimes the "apply*" are missing. Therefore, it may be better + // to check against "<>0" instead of "=1" s1 := GetAttrValue(node, 'numFmtId'); s2 := GetAttrValue(node, 'applyNumberFormat'); - if s2 = '1' then xf.NumFmtIndex := StrToInt(s1); + if s2 <> '0' then xf.NumFmtIndex := StrToInt(s1); s1 := GetAttrValue(node, 'fontId'); s2 := GetAttrValue(node, 'applyFont'); - if s2 = '1' then xf.FontIndex := StrToInt(s1); + if s2 <> '0' then xf.FontIndex := StrToInt(s1); s1 := GetAttrValue(node, 'fillId'); s2 := GetAttrValue(node, 'applyFill'); - if s2 = '1' then xf.FillIndex := StrToInt(s1); + if s2 <> '0' then xf.FillIndex := StrToInt(s1); s1 := GetAttrValue(node, 'borderId'); s2 := GetAttrValue(node, 'applyBorder'); - if s2 = '1' then xf.BorderIndex := StrToInt(s1); + if s2 <> '0' then xf.BorderIndex := StrToInt(s1); s2 := GetAttrValue(node, 'applyAlignment'); - if s2 = '1' then begin + if s2 <> '0' then begin childNode := node.FirstChild; while Assigned(childNode) do begin nodeName := childNode.NodeName; @@ -764,7 +766,7 @@ begin xf.VertAlignment := vaBottom; s1 := GetAttrValue(childNode, 'wrapText'); - if s1 = '1' then + if s1 <> '0' then xf.WordWrap := true; s1 := GetAttrValue(childNode, 'textRotation');