Merge branch 'main' into 'main'

LazReport export filter text alignment

See merge request freepascal.org/lazarus/lazarus!60
This commit is contained in:
Juha Manninen 2022-01-24 21:40:28 +00:00
commit 5563e5ff8a
2 changed files with 9 additions and 3 deletions

View File

@ -12413,7 +12413,7 @@ begin
FontStyle := frGetFontStyle(Font.Style); FontStyle := frGetFontStyle(Font.Style);
FontColor := Font.Color; FontColor := Font.Color;
FontCharset := Font.Charset; FontCharset := Font.Charset;
Alignment := Alignment; PfrTextRec(p)^.Alignment := Alignment;
end; end;
end; end;
end; end;

View File

@ -193,7 +193,7 @@ begin
end; end;
end; end;
s := '<table align="center" width="90%">'+LineEnding; s := '<table align="center" width="90%" cellspacing="0" style="border-collapse: collapse;">'+LineEnding;
s += '<tr>'; s += '<tr>';
for j:=1 to xPos.Count do for j:=1 to xPos.Count do
s += '<td></td>'; s += '<td></td>';
@ -301,7 +301,7 @@ begin
Result := p^.FontName; Result := p^.FontName;
Result += LowerCase(IntToHex(p^.FontSize, 2) + IntToHex(p^.FontStyle, 2) + Result += LowerCase(IntToHex(p^.FontSize, 2) + IntToHex(p^.FontStyle, 2) +
IntToHex(p^.FontColor, 8) + IntToHex(p^.FillColor, 8) + IntToHex(p^.FontColor, 8) + IntToHex(p^.FillColor, 8) +
IntToHex(Integer(p^.Borders), 2)); IntToHex(Integer(p^.Borders), 2) + IntToHex(Ord(p^.Alignment), 2));
for x:=1 to Length(Result) do for x:=1 to Length(Result) do
if not (Result[x] in ['$', '%', '&', '0'..'9', '@'..'z']) then if not (Result[x] in ['$', '%', '&', '0'..'9', '@'..'z']) then
Result[x]:= '_'; Result[x]:= '_';
@ -371,6 +371,12 @@ begin
s += Format(' border-width: %dpx;%s', [p^.BorderWidth,LineEnding]); s += Format(' border-width: %dpx;%s', [p^.BorderWidth,LineEnding]);
s += Format(' border-color: %s;%s', [ColorToHex(p^.BorderColor),LineEnding]); s += Format(' border-color: %s;%s', [ColorToHex(p^.BorderColor),LineEnding]);
end; end;
case p^.Alignment of
taRightJustify: s += ' text-align: right;';
taCenter: s += ' text-align: center;';
else
s += ' text-align: left;';
end;
s += ' } '+LineEnding+LineEnding; s += ' } '+LineEnding+LineEnding;
end; end;
cssStyles[Result].styleInfo:= s; cssStyles[Result].styleInfo:= s;