mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 20:20:36 +02:00
SynEdit: Fixed possible crash when PropertyEditor was updated after items where deselected
git-svn-id: trunk@18333 -
This commit is contained in:
parent
a47670f307
commit
8c0f2f5c04
@ -264,8 +264,15 @@ procedure TSynObjectPartListPropertyEditorForm.UpdateButtons;
|
|||||||
var
|
var
|
||||||
I: Integer;
|
I: Integer;
|
||||||
begin
|
begin
|
||||||
|
if SynObjectPartList = nil then begin
|
||||||
|
AddButton.Enabled := False;
|
||||||
|
DeleteButton.Enabled := False;
|
||||||
|
MoveUpButton.Enabled := False;
|
||||||
|
MoveDownButton.Enabled := False;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
I := SynObjectPartsListBox.ItemIndex;
|
I := SynObjectPartsListBox.ItemIndex;
|
||||||
AddButton.Enabled := SynObjectPartList <> nil;
|
AddButton.Enabled := True;
|
||||||
DeleteButton.Enabled := I > -1;
|
DeleteButton.Enabled := I > -1;
|
||||||
MoveUpButton.Enabled := I > 0;
|
MoveUpButton.Enabled := I > 0;
|
||||||
MoveDownButton.Enabled := (I >= 0) and (I < SynObjectPartList.Count - 1);
|
MoveDownButton.Enabled := (I >= 0) and (I < SynObjectPartList.Count - 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user