fpspreadsheet: More robust evaluation of xf style attributes but the OOXML reader (check "applyXXXX" against "<>'0'" instead of "='1'")

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3459 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2014-08-09 11:14:22 +00:00
parent 83db4e3fc4
commit a5495c97b5
2 changed files with 68 additions and 7 deletions

View File

@ -15,8 +15,67 @@
<CharSet Value=""/>
<StringTable ProductVersion=""/>
</VersionInfo>
<BuildModes Count="1">
<BuildModes Count="3">
<Item1 Name="default" Default="True"/>
<Item2 Name="Debug">
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="spready"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<UseAnsiStrings Value="False"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Release">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="spready"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<UseAnsiStrings Value="False"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<Optimizations>
<OptimizationLevel Value="3"/>
</Optimizations>
</CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="False"/>
</Debugging>
<LinkSmart Value="True"/>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>

View File

@ -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');