IDE: Improve removing unknown component properties. Issue #40377.

This commit is contained in:
Juha 2023-07-16 15:48:01 +03:00
parent d9608a3489
commit 27f6e20118
2 changed files with 10 additions and 4 deletions

View File

@ -332,6 +332,7 @@ type
procedure SetDisableI18NForLFM(const AValue: boolean);
procedure SetFileReadOnly(const AValue: Boolean);
procedure SetComponent(const AValue: TComponent);
procedure SetHasErrorInLFM(AValue: boolean);
procedure SetLoaded(const AValue: Boolean);
procedure SetLoadedDesigner(const AValue: Boolean);
procedure SetModified(const AValue: boolean);
@ -472,7 +473,7 @@ type
property Loaded: Boolean read fLoaded write SetLoaded;
property LoadedDesigner: Boolean read fLoadedDesigner write SetLoadedDesigner;
property LoadingComponent: boolean read FLoadingComponent write FLoadingComponent;
property HasErrorInLFM: boolean read fHasErrorInLFM write fHasErrorInLFM;
property HasErrorInLFM: boolean read fHasErrorInLFM write SetHasErrorInLFM;
property Modified: boolean read GetModified write SetModified;// not Session data
property SessionModified: boolean read FSessionModified write SetSessionModified;
property OnFileBackup: TOnFileBackup read fOnFileBackup write fOnFileBackup;
@ -2639,6 +2640,13 @@ begin
FResourceBaseClass:=GetComponentBaseClass(fComponent.ClassType);
end;
procedure TUnitInfo.SetHasErrorInLFM(AValue: boolean);
begin
if fHasErrorInLFM=AValue then Exit;
fHasErrorInLFM:=AValue;
Modified:=true;
end;
procedure TUnitInfo.SetIsPartOfProject(const AValue: boolean);
begin
if IsPartOfProject=AValue then exit;

View File

@ -6299,10 +6299,8 @@ begin
end;
LFMUnitInfo:=Project1.UnitWithEditorComponent(SourceEditorManager.ActiveEditor);
Result:=CheckLFMInEditor(LFMUnitInfo, true);
if Result=mrOk then begin
if Result=mrOk then
AnUnitInfo.HasErrorInLFM:=False;
Result:=mrCancel;
end;
exit;
end;
finally