diff --git a/components/fpspreadsheet/source/common/fpsopendocument.pas b/components/fpspreadsheet/source/common/fpsopendocument.pas index d9010b0e2..1153ffe98 100644 --- a/components/fpspreadsheet/source/common/fpsopendocument.pas +++ b/components/fpspreadsheet/source/common/fpsopendocument.pas @@ -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;