From 8ed63aff69100685f57c736e46505fa0def806f7 Mon Sep 17 00:00:00 2001 From: juha Date: Thu, 22 Dec 2016 22:29:17 +0000 Subject: [PATCH] IDE: Update OI properly when closing a project. Issue #31153. git-svn-id: trunk@53764 - --- designer/controlselection.pp | 6 ------ designer/designer.pp | 3 --- ide/main.pp | 10 ++++++---- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/designer/controlselection.pp b/designer/controlselection.pp index 6a17c95d62..293b268eb7 100644 --- a/designer/controlselection.pp +++ b/designer/controlselection.pp @@ -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); diff --git a/designer/designer.pp b/designer/designer.pp index 99761b6908..b02ebf6744 100644 --- a/designer/designer.pp +++ b/designer/designer.pp @@ -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; diff --git a/ide/main.pp b/ide/main.pp index 02c3c0e363..8336a69254 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -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