fpspreadsheet: Improved handling of default cell format in ods.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5322 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-11-07 13:47:57 +00:00
parent e36f26bc92
commit 7d38a1fa62

View File

@ -3986,6 +3986,7 @@ begin
if not Assigned(AStylesNode) then
exit;
nodeName := AStylesNode.NodeName;
numFmtIndexDefault := FindNumFormatByName('N0');
styleNode := AStylesNode.FirstChild;
@ -3996,7 +3997,7 @@ begin
family := GetAttrValue(stylenode, 'style:family');
if family = 'table-cell' then begin
InitFormatRecord(fmt);
fmt.Name := 'Default';
fmt.Name := 'DefaultStyle';
fnt := FWorkbook.GetFont(fmt.FontIndex);
fntName := fnt.FontName;
fntSize := fnt.Size;
@ -4054,6 +4055,12 @@ begin
idx := FCellFormatList.FindIndexOfName(parentstyle);
if idx > -1 then
fmt := FCellFormatList[idx]^;
end else
if styleName <> '' then
begin
idx := FCellFormatList.FindIndexOfName(stylename);
if idx > -1 then
fmt := FCellFormatList[idx]^;
end;
fmt.Name := styleName;