1
0
mirror of synced 2024-11-22 01:53:50 +00:00

Fixed: List index out of bounds when multiple containers are on a form

Fixed: no need to move/remove graphics in the internal list if conversion is disabled
This commit is contained in:
Mark van Renswoude 2012-05-02 13:59:12 +00:00
parent 9feef16168
commit e681c29456

View File

@ -662,8 +662,11 @@ begin
opRemove: opRemove:
begin begin
if AComponent is TX2GraphicContainerItem then if (AComponent is TX2GraphicContainerItem) and
RemoveGraphic(TX2GraphicContainerItem(AComponent)) (TX2GraphicContainerItem(AComponent).Container = Self) then
begin
RemoveGraphic(TX2GraphicContainerItem(AComponent));
end;
else if AComponent is TX2GraphicList then else if AComponent is TX2GraphicList then
Lists.Remove(AComponent); Lists.Remove(AComponent);
@ -1262,6 +1265,8 @@ end;
procedure TX2GraphicList.DeleteImage(const AIndex: Integer); procedure TX2GraphicList.DeleteImage(const AIndex: Integer);
begin
if CanConvert then
begin begin
BeginUpdate; BeginUpdate;
try try
@ -1269,10 +1274,14 @@ begin
finally finally
EndUpdate; EndUpdate;
end; end;
end else
UpdateImageCount;
end; end;
procedure TX2GraphicList.MoveImage(const AOldIndex, ANewIndex: Integer); procedure TX2GraphicList.MoveImage(const AOldIndex, ANewIndex: Integer);
begin
if CanConvert then
begin begin
BeginUpdate; BeginUpdate;
try try
@ -1281,6 +1290,7 @@ begin
EndUpdate; EndUpdate;
end; end;
end; end;
end;
procedure TX2GraphicList.UpdateImageCount; procedure TX2GraphicList.UpdateImageCount;