mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 03:49:30 +02:00
TurboPower_ipro: Some more improvements in line spacings.
git-svn-id: trunk@58909 -
This commit is contained in:
parent
69221ae81d
commit
4c032af54f
@ -245,8 +245,8 @@ type
|
|||||||
FCurProps : TIpHtmlProps;
|
FCurProps : TIpHtmlProps;
|
||||||
FBlockMin, FBlockMax : Integer;
|
FBlockMin, FBlockMax : Integer;
|
||||||
function GetProps: TIpHtmlProps;
|
function GetProps: TIpHtmlProps;
|
||||||
|
procedure ProcessDuplicateLFs;
|
||||||
procedure RemoveLeadingLFs;
|
procedure RemoveLeadingLFs;
|
||||||
procedure RemoveDuplicateLFs;
|
|
||||||
public
|
public
|
||||||
FPageRect : TRect;
|
FPageRect : TRect;
|
||||||
constructor Create(AOwner: TIpHtmlNodeCore); virtual;
|
constructor Create(AOwner: TIpHtmlNodeCore); virtual;
|
||||||
@ -4021,16 +4021,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIpHtmlBaseLayouter.RemoveLeadingLFs;
|
procedure TIpHtmlBaseLayouter.ProcessDuplicateLFs;
|
||||||
begin
|
|
||||||
while (FElementQueue.Count>0)
|
|
||||||
and (PIpHtmlElement(FElementQueue[0])^.ElementType in [etSoftLF, etHardLF]) do
|
|
||||||
FElementQueue.Delete(0);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TIpHtmlBaseLayouter.RemoveDuplicateLFs;
|
|
||||||
var
|
var
|
||||||
i: Integer;
|
i, ilast: Integer;
|
||||||
elem: PIpHtmlElement;
|
elem: PIpHtmlElement;
|
||||||
prevelem: PIpHtmlElement;
|
prevelem: PIpHtmlElement;
|
||||||
begin
|
begin
|
||||||
@ -4048,16 +4041,21 @@ begin
|
|||||||
if (prevelem.ElementType = etSoftLF) then begin
|
if (prevelem.ElementType = etSoftLF) then begin
|
||||||
prevelem.LFHeight := MaxI2(prevelem.LFHeight, elem.LFHeight);
|
prevelem.LFHeight := MaxI2(prevelem.LFHeight, elem.LFHeight);
|
||||||
FElementQueue.Delete(i-1);
|
FElementQueue.Delete(i-1);
|
||||||
end else
|
|
||||||
if (prevelem.ElementType = etHardLF) then begin
|
|
||||||
//prevelem.LFHeight := prevelem.LFHeight + elem.LFHeight;
|
|
||||||
//FElementQueue.Delete(i);
|
|
||||||
end;
|
end;
|
||||||
|
// nothing to do for etHardLF
|
||||||
end;
|
end;
|
||||||
dec(i);
|
dec(i);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TIpHtmlBaseLayouter.RemoveLeadingLFs;
|
||||||
|
begin
|
||||||
|
while (FElementQueue.Count>0)
|
||||||
|
and (PIpHtmlElement(FElementQueue[0])^.ElementType in [etSoftLF, etHardLF]) do
|
||||||
|
FElementQueue.Delete(0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TIpHtmlBaseTableLayouter }
|
{ TIpHtmlBaseTableLayouter }
|
||||||
|
|
||||||
constructor TIpHtmlBaseTableLayouter.Create(AOwner: TIpHtmlNodeCore);
|
constructor TIpHtmlBaseTableLayouter.Create(AOwner: TIpHtmlNodeCore);
|
||||||
@ -10010,17 +10008,18 @@ begin
|
|||||||
hf := Props.FontSize;
|
hf := Props.FontSize;
|
||||||
if FChildren.Count > 0 then begin
|
if FChildren.Count > 0 then begin
|
||||||
h := GetMargin(Props.ElemMarginTop, hf div 2);
|
h := GetMargin(Props.ElemMarginTop, hf div 2);
|
||||||
elem := Owner.BuildLinefeedEntry(etHardLF, h);
|
elem := Owner.BuildLinefeedEntry(etSoftLF, h);
|
||||||
EnqueueElement(elem);
|
EnqueueElement(elem);
|
||||||
end;
|
end;
|
||||||
inherited Enqueue;
|
inherited Enqueue;
|
||||||
if FChildren.Count > 0 then begin
|
if FChildren.Count > 0 then begin
|
||||||
h := GetMargin(Props.ElemMarginBottom, hf div 4);
|
h := GetMargin(Props.ElemMarginBottom, hf div 4);
|
||||||
elem := Owner.BuildLinefeedEntry(etHardLF, h);
|
elem := Owner.BuildLinefeedEntry(etSoftLF, h);
|
||||||
EnqueueElement(elem);
|
EnqueueElement(elem);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TIpHtmlNodeLI }
|
{ TIpHtmlNodeLI }
|
||||||
|
|
||||||
procedure TIpHtmlNodeLI.CalcMinMaxWidth(var Min, Max: Integer);
|
procedure TIpHtmlNodeLI.CalcMinMaxWidth(var Min, Max: Integer);
|
||||||
@ -10137,9 +10136,10 @@ var
|
|||||||
elem: PIpHtmlElement;
|
elem: PIpHtmlElement;
|
||||||
begin
|
begin
|
||||||
if (ParentNode is TIpHtmlNodeP) or
|
if (ParentNode is TIpHtmlNodeP) or
|
||||||
|
(ParentNode is TIpHtmlNodeDIV) or
|
||||||
(ParentNode is TIpHtmlNodeLI) or
|
(ParentNode is TIpHtmlNodeLI) or
|
||||||
(ParentNode is TIpHtmlNodePRE) or
|
// (ParentNode is TIpHtmlNodePRE) or
|
||||||
(ParentNode is TIpHtmlNodeDIV)
|
(ParentNode is TIpHtmlNodeHeader)
|
||||||
then
|
then
|
||||||
h := 0
|
h := 0
|
||||||
else
|
else
|
||||||
|
@ -188,7 +188,7 @@ begin
|
|||||||
|
|
||||||
if FBlockOwner is TIpHtmlNodeBody then
|
if FBlockOwner is TIpHtmlNodeBody then
|
||||||
RemoveLeadingLFs;
|
RemoveLeadingLFs;
|
||||||
RemoveDuplicateLFs;
|
ProcessDuplicateLFs;
|
||||||
|
|
||||||
if not RenderProps.IsEqualTo(Props) then
|
if not RenderProps.IsEqualTo(Props) then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user