|
@@ -357,7 +357,8 @@ end;
|
|
|
|
|
|
procedure TCollection.EndUpdate;
|
|
procedure TCollection.EndUpdate;
|
|
begin
|
|
begin
|
|
- dec(FUpdateCount);
|
|
|
|
|
|
+ if FUpdateCount>0 then
|
|
|
|
+ dec(FUpdateCount);
|
|
if FUpdateCount=0 then
|
|
if FUpdateCount=0 then
|
|
Changed;
|
|
Changed;
|
|
end;
|
|
end;
|
|
@@ -396,7 +397,7 @@ end;
|
|
|
|
|
|
procedure TCollection.Notify(Item: TCollectionItem;Action: TCollectionNotification);
|
|
procedure TCollection.Notify(Item: TCollectionItem;Action: TCollectionNotification);
|
|
begin
|
|
begin
|
|
- if Assigned(FObservers) then
|
|
|
|
|
|
+ if Assigned(FObservers) and (FUpdateCount = 0) then
|
|
Case Action of
|
|
Case Action of
|
|
cnAdded : FPONotifyObservers(Self,ooAddItem,Pointer(Item));
|
|
cnAdded : FPONotifyObservers(Self,ooAddItem,Pointer(Item));
|
|
cnExtracting : FPONotifyObservers(Self,ooDeleteItem,Pointer(Item));
|
|
cnExtracting : FPONotifyObservers(Self,ooDeleteItem,Pointer(Item));
|
|
@@ -419,7 +420,8 @@ procedure TCollection.Exchange(Const Index1, index2: integer);
|
|
|
|
|
|
begin
|
|
begin
|
|
FItems.Exchange(Index1,Index2);
|
|
FItems.Exchange(Index1,Index2);
|
|
- FPONotifyObservers(Self,ooChange,Nil);
|
|
|
|
|
|
+ if FUpdateCount = 0 then
|
|
|
|
+ FPONotifyObservers(Self,ooChange,Nil);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|