From a408b5cfdca23d1a0b060f01d3d391c68bf28c58 Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 11 Oct 2024 10:37:10 +0200 Subject: [PATCH] ide fixed av in path editor dlg on replace on cocoa --- ide/patheditordlg.pas | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ide/patheditordlg.pas b/ide/patheditordlg.pas index fdcb08dd31..25a7d8f6b1 100644 --- a/ide/patheditordlg.pas +++ b/ide/patheditordlg.pas @@ -26,7 +26,7 @@ uses LCLType, Forms, Controls, Buttons, StdCtrls, Dialogs, Menus, Graphics, ButtonPanel, Clipbrd, // LazUtils - FileUtil, LazFileUtils, LazStringUtils, LazFileCache, LazUTF8, + FileUtil, LazFileUtils, LazStringUtils, LazFileCache, LazUTF8, LazLoggerBase, // LazControls ShortPathEdit, // IdeIntf @@ -265,10 +265,14 @@ begin end; procedure TPathEditorDialog.ReplaceButtonClick(Sender: TObject); +var + i: Integer; begin with PathListBox do begin - Items[ItemIndex]:=BaseRelative(DirectoryEdit.Text); - Items.Objects[ItemIndex]:=PathMayExist(DirectoryEdit.Text); + i:=ItemIndex; + if i<0 then exit; + Items[i]:=BaseRelative(DirectoryEdit.Text); + Items.Objects[i]:=PathMayExist(DirectoryEdit.Text); UpdateButtons; end; end;