mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 06:16:05 +02:00
lazutils: TDOMNode.GetLevel
git-svn-id: trunk@35467 -
This commit is contained in:
parent
e307672e60
commit
75e607c431
@ -277,6 +277,7 @@ type
|
|||||||
function GetNextNodeSkipChildren: TDOMNode; // first next sibling, then next sibling of parent, ...
|
function GetNextNodeSkipChildren: TDOMNode; // first next sibling, then next sibling of parent, ...
|
||||||
function GetPrevNode: TDOMNode; // the reverse of GetNext
|
function GetPrevNode: TDOMNode; // the reverse of GetNext
|
||||||
function GetLastLeaf: TDOMNode; // get last child of last child of ...
|
function GetLastLeaf: TDOMNode; // get last child of last child of ...
|
||||||
|
function GetLevel: integer; // root node has 0
|
||||||
|
|
||||||
function InsertBefore(NewChild, RefChild: TDOMNode): TDOMNode; virtual;
|
function InsertBefore(NewChild, RefChild: TDOMNode): TDOMNode; virtual;
|
||||||
function ReplaceChild(NewChild, OldChild: TDOMNode): TDOMNode; virtual;
|
function ReplaceChild(NewChild, OldChild: TDOMNode): TDOMNode; virtual;
|
||||||
@ -1070,6 +1071,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TDOMNode.GetLevel: integer;
|
||||||
|
var
|
||||||
|
Node: TDOMNode;
|
||||||
|
begin
|
||||||
|
Result:=0;
|
||||||
|
Node:=ParentNode;
|
||||||
|
while Node<>nil do begin
|
||||||
|
inc(Result);
|
||||||
|
Node:=Node.ParentNode;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TDOMNode.GetFirstChild: TDOMNode;
|
function TDOMNode.GetFirstChild: TDOMNode;
|
||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
|
Loading…
Reference in New Issue
Block a user