IDE: Minor optimization and formatting.

This commit is contained in:
Juha 2023-03-26 19:02:01 +03:00
parent 0f4a7bbc7e
commit 5dc0aebd74
2 changed files with 24 additions and 26 deletions

View File

@ -4331,8 +4331,7 @@ begin
if AnUnitName='' then exit(-1);
Result:=UnitCount-1;
while (Result>=0) do begin
if ((OnlyProjectUnits and Units[Result].IsPartOfProject)
or (not OnlyProjectUnits))
if (Units[Result].IsPartOfProject or not OnlyProjectUnits)
and (IgnoreUnit<>Units[Result])
and (Units[Result].Unit_Name<>'')
then begin
@ -4349,8 +4348,7 @@ function TProject.IndexOfUnitWithComponent(AComponent: TComponent;
begin
Result:=UnitCount-1;
while (Result>=0) do begin
if (OnlyProjectUnits and Units[Result].IsPartOfProject)
or (not OnlyProjectUnits)
if (Units[Result].IsPartOfProject or not OnlyProjectUnits)
and (IgnoreUnit<>Units[Result]) then begin
if Units[Result].Component=AComponent then
exit;
@ -4364,8 +4362,7 @@ function TProject.IndexOfUnitWithComponentName(const AComponentName: string;
begin
Result:=UnitCount-1;
while (Result>=0) do begin
if ((OnlyProjectUnits and Units[Result].IsPartOfProject)
or (not OnlyProjectUnits))
if (Units[Result].IsPartOfProject or not OnlyProjectUnits)
and (IgnoreUnit<>Units[Result]) then begin
if (CompareText(Units[Result].ComponentName,AComponentName)=0)
or ((Units[Result].Component<>nil)
@ -4388,7 +4385,8 @@ begin
end;
function TProject.GetResourceFile(AnUnitInfo: TUnitInfo; Index:integer): TCodeBuffer;
var i, LinkIndex: integer;
var
i, LinkIndex: integer;
begin
LinkIndex:=-1;
i:=0;

View File

@ -1202,13 +1202,6 @@ begin
DoMoveDependency(-1);
end;
procedure TPackageEditorForm.OnIdle(Sender: TObject; var Done: Boolean);
begin
if fUpdateLock>0 then exit;
IdleConnected:=false;
UpdatePending;
end;
procedure TPackageEditorForm.MoveDownBtnClick(Sender: TObject);
begin
if SortAlphabetically then exit;
@ -1218,6 +1211,13 @@ begin
DoMoveDependency(1)
end;
procedure TPackageEditorForm.OnIdle(Sender: TObject; var Done: Boolean);
begin
if fUpdateLock>0 then exit;
IdleConnected:=false;
UpdatePending;
end;
procedure TPackageEditorForm.OpenButtonClick(Sender: TObject);
var
i: Integer;