IDE: find in files: expand all nodes

git-svn-id: trunk@17374 -
This commit is contained in:
mattias 2008-11-13 16:09:14 +00:00
parent 47a79e54b2
commit 68c63d1012

View File

@ -510,7 +510,8 @@ begin
ShownText:=CurrentTV.BeautifyLine(SearchPos); ShownText:=CurrentTV.BeautifyLine(SearchPos);
LastPos:=nil; LastPos:=nil;
if CurrentTV.UpdateState then begin if CurrentTV.UpdateState then begin
if (CurrentTV.UpdateItems.Count>0) and (CurrentTV.UpdateItems.Objects[CurrentTV.UpdateItems.Count-1] is TLazSearchMatchPos) then if (CurrentTV.UpdateItems.Count>0)
and (CurrentTV.UpdateItems.Objects[CurrentTV.UpdateItems.Count-1] is TLazSearchMatchPos) then
LastPos:=TLazSearchMatchPos(CurrentTV.UpdateItems.Objects[CurrentTV.UpdateItems.Count-1]); LastPos:=TLazSearchMatchPos(CurrentTV.UpdateItems.Objects[CurrentTV.UpdateItems.Count-1]);
end else end else
if (CurrentTV.Items.Count>0) and Assigned(CurrentTV.Items[CurrentTV.Items.Count-1].Data) then if (CurrentTV.Items.Count>0) and Assigned(CurrentTV.Items[CurrentTV.Items.Count-1].Data) then
@ -1033,6 +1034,7 @@ end;
procedure TLazSearchResultTV.AddNode(Line: string; MatchPos: TLazSearchMatchPos); procedure TLazSearchResultTV.AddNode(Line: string; MatchPos: TLazSearchMatchPos);
var var
Node: TTreeNode; Node: TTreeNode;
ChildNode: TTreeNode;
begin begin
Node := Items.FindNodeWithText(MatchPos.FileName); Node := Items.FindNodeWithText(MatchPos.FileName);
@ -1040,8 +1042,9 @@ begin
if not Assigned(Node) then if not Assigned(Node) then
Node := Items.AddFirst(Node, MatchPos.FileName); Node := Items.AddFirst(Node, MatchPos.FileName);
Node := Items.AddChildFirst(Node, Line); ChildNode := Items.AddChildFirst(Node, Line);
Node.Data := MatchPos; Node.Expanded:=true;
ChildNode.Data := MatchPos;
end; end;
{****************************************************************************** {******************************************************************************