Converter: Simplify single unit conversion. fOwnerConverter.fAllCommentedUnits is Nil then.

git-svn-id: trunk@56663 -
This commit is contained in:
juha 2017-12-07 16:41:24 +00:00
parent be0dcc0b50
commit 12ad076089
2 changed files with 4 additions and 7 deletions

View File

@ -724,12 +724,8 @@ begin
ExtractFileName(fLazUnitFilename), fOwnerConverter.fSettings.SupportDelphi);
case Result of
// mrOK means: Comment out.
mrOK: begin
if fOwnerConverter is TConvertDelphiProjPack then
MoveMissingToComment(fOwnerConverter.fAllCommentedUnits)
else
MoveMissingToComment(Nil);
end;
mrOK:
MoveMissingToComment(fOwnerConverter.fAllCommentedUnits);
// mrYes means: Search for unit path.
mrYes: begin
UnitDirDialog:=TSelectDirectoryDialog.Create(nil);

View File

@ -463,8 +463,9 @@ procedure TUsedUnits.CommentAutomatic(ACommentedUnits: TStringList);
var
i, x: Integer;
begin
if ACommentedUnits = Nil then Exit;
for i:=fMissingUnits.Count-1 downto 0 do begin
if Assigned(ACommentedUnits) and ACommentedUnits.Find(fMissingUnits[i], x) then
if ACommentedUnits.Find(fMissingUnits[i], x) then
begin
fUnitsToComment.Add(fMissingUnits[i]);
fMissingUnits.Delete(i);