mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 10:59:11 +02:00
fpvectorial: table rendering fixes
git-svn-id: trunk@47858 -
This commit is contained in:
parent
a045a18155
commit
b3639a8fd2
@ -1687,9 +1687,10 @@ var
|
|||||||
CurRow: TvTableRow;
|
CurRow: TvTableRow;
|
||||||
CurCell: TvTableCell;
|
CurCell: TvTableCell;
|
||||||
lLeft, lTop, lRight, lBottom, lWidth: Double;
|
lLeft, lTop, lRight, lBottom, lWidth: Double;
|
||||||
col, row: Integer;
|
col, row, i: Integer;
|
||||||
//DebugStr: string;
|
//DebugStr: string;
|
||||||
OriginalColWidthsInMM: array of Double;
|
OriginalColWidthsInMM: array of Double;
|
||||||
|
CurRowTableWidth: Double;
|
||||||
begin
|
begin
|
||||||
SetLength(ColWidthsInMM, GetRowCount());
|
SetLength(ColWidthsInMM, GetRowCount());
|
||||||
|
|
||||||
@ -1707,6 +1708,7 @@ begin
|
|||||||
for row := 0 to GetRowCount()-1 do
|
for row := 0 to GetRowCount()-1 do
|
||||||
begin
|
begin
|
||||||
CurRow := GetRow(row);
|
CurRow := GetRow(row);
|
||||||
|
CurRowTableWidth := 0;
|
||||||
|
|
||||||
for col := 0 to CurRow.GetCellCount()-1 do
|
for col := 0 to CurRow.GetCellCount()-1 do
|
||||||
begin
|
begin
|
||||||
@ -1715,16 +1717,25 @@ begin
|
|||||||
|
|
||||||
// skip cells with span since they are complex
|
// skip cells with span since they are complex
|
||||||
// skip columns with width pre-set
|
// skip columns with width pre-set
|
||||||
if (OriginalColWidthsInMM[col] > 0) or (CurCell.SpannedCols > 0) then
|
if (OriginalColWidthsInMM[col] > 0) then
|
||||||
begin
|
begin
|
||||||
TableWidth := TableWidth + ColWidthsInMM[col];
|
CurRowTableWidth := CurRowTableWidth + ColWidthsInMM[col];
|
||||||
|
Continue;
|
||||||
|
end;
|
||||||
|
if (CurCell.SpannedCols > 1) then
|
||||||
|
begin
|
||||||
|
CurRowTableWidth := CurRowTableWidth + ColWidthsInMM[col];
|
||||||
|
for i := 0 to CurCell.SpannedCols-1 do
|
||||||
|
CurRowTableWidth := CurRowTableWidth + ColWidthsInMM[col+i];
|
||||||
Continue;
|
Continue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
lWidth := CurCell.CalculateMaxNeededWidth(ADest);
|
lWidth := CurCell.CalculateMaxNeededWidth(ADest);
|
||||||
ColWidthsInMM[col] := Max(ColWidthsInMM[col], lWidth);
|
ColWidthsInMM[col] := Max(ColWidthsInMM[col], lWidth);
|
||||||
TableWidth := TableWidth + ColWidthsInMM[col];
|
CurRowTableWidth := CurRowTableWidth + ColWidthsInMM[col];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TableWidth := Max(TableWidth, CurRowTableWidth);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// If it goes over the page width, recalculate with equal sizes (in the future do better)
|
// If it goes over the page width, recalculate with equal sizes (in the future do better)
|
||||||
@ -1819,7 +1830,7 @@ begin
|
|||||||
for col := 0 to CurRow.GetCellCount()-1 do
|
for col := 0 to CurRow.GetCellCount()-1 do
|
||||||
begin
|
begin
|
||||||
CurCell := CurRow.GetCell(col);
|
CurCell := CurRow.GetCell(col);
|
||||||
CurRowColCount := CurRowColCount + CurCell.SpannedCols + 1;
|
CurRowColCount := CurRowColCount + CurCell.SpannedCols;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result := Max(Result, CurRowColCount);
|
Result := Max(Result, CurRowColCount);
|
||||||
@ -7384,7 +7395,8 @@ begin
|
|||||||
lTextBody.Alignment := vsaJustifed;
|
lTextBody.Alignment := vsaJustifed;
|
||||||
lTextBody.MarginTop := 0;
|
lTextBody.MarginTop := 0;
|
||||||
lTextBody.MarginBottom := 2.12;
|
lTextBody.MarginBottom := 2.12;
|
||||||
lTextBody.SetElements := [spbfFontSize, spbfFontName, spbfAlignment, sseMarginTop, sseMarginBottom];
|
lTextBody.SetElements := [spbfFontSize, spbfFontName, spbfAlignment,
|
||||||
|
sseMarginTop, sseMarginBottom, spbfBrushStyle];
|
||||||
StyleTextBody := lTextBody;
|
StyleTextBody := lTextBody;
|
||||||
|
|
||||||
// Headings
|
// Headings
|
||||||
|
@ -211,7 +211,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// the caption spans all columns
|
// the caption spans all columns
|
||||||
Caption_Cell.SpannedCols := CurTable.GetColCount()-1;
|
Caption_Cell.SpannedCols := CurTable.GetColCount();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TvHTMLVectorialReader.ReadTableRowNode(ATable: TvTable; ANode: TDOMNode;
|
function TvHTMLVectorialReader.ReadTableRowNode(ATable: TvTable; ANode: TDOMNode;
|
||||||
|
Loading…
Reference in New Issue
Block a user