Fixes the dxftokentotree.pas performance and makes the dxf reader more powerful

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1472 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-01-30 14:37:28 +00:00
parent 2c37512236
commit 21518cb872
4 changed files with 93 additions and 31 deletions

View File

@@ -29,12 +29,17 @@ var
begin
if ATokens = nil then Exit;
for i := 0 to ATokens.Count - 1 do
begin
AToken := TDXFToken(ATokens.Items[i]);
NodeStr := Format('(%d %s)', [AToken.GroupCode, AToken.StrValue]);
NewNode := ATreeNodes.AddChild(ABaseNode, NodeStr);
ConvertDXFTokensToTreeNodes(AToken.Childs, NewNode.TreeNodes, NewNode);
ATreeNodes.BeginUpdate(); // Greatly speeds up the operation
try
for i := 0 to ATokens.Count - 1 do
begin
AToken := TDXFToken(ATokens.Items[i]);
NodeStr := Format('(%d %s)', [AToken.GroupCode, AToken.StrValue]);
NewNode := ATreeNodes.AddChild(ABaseNode, NodeStr);
ConvertDXFTokensToTreeNodes(AToken.Childs, NewNode.TreeNodes, NewNode);
end;
finally
ATreeNodes.EndUpdate();
end;
end;