From 608c82904f7156fc41068ca98cbca6ce1fc566f8 Mon Sep 17 00:00:00 2001 From: ondrej Date: Wed, 15 Apr 2020 10:54:21 +0000 Subject: [PATCH] IDE: Locals Dialog: evaluate all: avoid searching items by caption git-svn-id: trunk@62986 - --- debugger/localsdlg.pp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/debugger/localsdlg.pp b/debugger/localsdlg.pp index c7ef0adf5d..eae1e5bf17 100644 --- a/debugger/localsdlg.pp +++ b/debugger/localsdlg.pp @@ -77,7 +77,7 @@ type procedure actWathExecute(Sender: TObject); private FUpdateFlags: set of (ufNeedUpdating); - EvaluateAllCallbackCaption: string; + EvaluateAllCallbackItem: TListItem; procedure CopyRAWValueEvaluateCallback(Sender: TObject; ASuccess: Boolean; ResultText: String; ResultDBGType: TDBGType); procedure CopyValueEvaluateCallback(Sender: TObject; ASuccess: Boolean; @@ -352,9 +352,10 @@ var begin for I := 0 to lvLocals.Items.Count-1 do begin - EvaluateAllCallbackCaption := lvLocals.Items[I].Caption; - DebugBoss.Evaluate(EvaluateAllCallbackCaption, @EvaluateAllCallback, []); + EvaluateAllCallbackItem := lvLocals.Items[I]; + DebugBoss.Evaluate(EvaluateAllCallbackItem.Caption, @EvaluateAllCallback, []); end; + EvaluateAllCallbackItem := nil; end; procedure TLocalsDlg.LocalsChanged(Sender: TObject); @@ -516,15 +517,11 @@ end; procedure TLocalsDlg.EvaluateAllCallback(Sender: TObject; ASuccess: Boolean; ResultText: String; ResultDBGType: TDBGType); -var - Item: TListItem; begin if ASuccess then begin - ResultText := ExtractValue(ResultText, ResultDBGType.TypeName); - Item := lvLocals.Items.FindCaption(0, EvaluateAllCallbackCaption, False, True, False, False); - if Assigned(Item) then - Item.SubItems[0] := ResultText+' ('+ResultDBGType.Value.AsString+')'; // xxx + if Assigned(EvaluateAllCallbackItem) then + EvaluateAllCallbackItem.SubItems[0] := ExtractValue(ResultText, ResultDBGType.TypeName); end; FreeAndNil(ResultDBGType); end;