IDE: Update OI properly when closing a project. Issue #31153.

git-svn-id: trunk@53764 -
This commit is contained in:
juha 2016-12-22 22:29:17 +00:00
parent 52ab6a0253
commit 8ed63aff69
3 changed files with 6 additions and 13 deletions

View File

@ -397,7 +397,6 @@ type
procedure BeginUpdate;
procedure EndUpdate;
procedure DoChange(ForceUpdate: Boolean = False);
procedure IgnoreUpdate;
property UpdateLock: integer read FUpdateLock;
// items
@ -2089,11 +2088,6 @@ begin
end;
end;
procedure TControlSelection.IgnoreUpdate;
begin
FStates := FStates - cssSelectionChangeFlags;
end;
procedure TControlSelection.DoChangeProperties;
begin
if Assigned(OnPropertiesChanged) then OnPropertiesChanged(Self);

View File

@ -809,10 +809,7 @@ begin
// was FinalizeFreeDesigner
Include(FFlags, dfDestroyingForm);
// free or hide the form
TheControlSelection.BeginUpdate;
TheFormEditor.DeleteComponent(FLookupRoot,AFreeComponent);
TheControlSelection.IgnoreUpdate;
TheControlSelection.EndUpdate;
DisconnectComponent;
Free;
end;

View File

@ -8980,8 +8980,8 @@ begin
{$IFDEF IDE_DEBUG}
debugln('[TMainIDE.OnControlSelectionChanged]');
{$ENDIF}
if (TheControlSelection = nil) or (FormEditor1 = nil) then Exit;
Assert(Assigned(TheControlSelection), 'TMainIDE.OnControlSelectionChanged: TheControlSelection=Nil.');
if FormEditor1 = nil then Exit;
NewSelection := TPersistentSelectionList.Create;
NewSelection.ForceUpdate := ForceUpdate;
for i := 0 to TheControlSelection.Count - 1 do
@ -8995,7 +8995,8 @@ end;
procedure TMainIDE.OnControlSelectionPropsChanged(Sender: TObject);
begin
if (TheControlSelection=nil) or (FormEditor1=nil) or (ObjectInspector1=nil) then exit;
Assert(Assigned(TheControlSelection), 'TMainIDE.OnControlSelectionPropsChanged: TheControlSelection=Nil.');
if (FormEditor1=nil) or (ObjectInspector1=nil) then exit;
ObjectInspector1.SaveChanges; // Save in any case, PropEditor value may have changed
ObjectInspector1.RefreshPropertyValues;
end;
@ -9003,7 +9004,8 @@ end;
procedure TMainIDE.OnControlSelectionFormChanged(Sender: TObject; OldForm,
NewForm: TCustomForm);
begin
if (TheControlSelection=nil) or (FormEditor1=nil) then exit;
Assert(Assigned(TheControlSelection), 'TMainIDE.OnControlSelectionFormChanged: TheControlSelection=Nil.');
if FormEditor1=nil then exit;
if OldForm<>nil then
OldForm.Invalidate;
if TheControlSelection.LookupRoot<>nil then