fpspreadsheet: More conservative handling of conditional font formatting by the ODS writer.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7563 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-07-26 09:53:26 +00:00
parent ea07a82dbf
commit ee32147ee4

View File

@ -8064,10 +8064,12 @@ begin
defFnt := (Workbook as TsWorkbook).GetDefaultFont;
if AFont = nil then AFont := defFnt;
Result := Result + Format('style:font-name="%s" ', [AFont.FontName]);
if AFont.FontName <> '' then
Result := Result + Format('style:font-name="%s" ', [AFont.FontName]);
Result := Result + Format('fo:font-size="%.1fpt" style:font-size-asian="%.1fpt" style:font-size-complex="%.1fpt" ',
[AFont.Size, AFont.Size, AFont.Size], FPointSeparatorSettings);
if AFont.Size > 0 then
Result := Result + Format('fo:font-size="%.1fpt" style:font-size-asian="%.1fpt" style:font-size-complex="%.1fpt" ',
[AFont.Size, AFont.Size, AFont.Size], FPointSeparatorSettings);
if fssBold in AFont.Style then
Result := Result + 'fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" ';
@ -8087,7 +8089,7 @@ begin
if AFont.Position = fpSuperscript then
Result := Result + 'style:text-position="super 58%" ';
if AFont.Color <> defFnt.Color then
if (AFont.Color <> defFnt.Color) and (AFont.Color <> scNotDefined) then
Result := Result + Format('fo:color="%s" ', [ColorToHTMLColorStr(AFont.Color)]);
end;