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);
FontColor := Font.Color;
FontCharset := Font.Charset;
Alignment := Alignment;
PfrTextRec(p)^.Alignment := Alignment;
end;
end;
end;

View File

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