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:
parent
9feef16168
commit
e681c29456
@ -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);
|
||||||
@ -1263,22 +1266,29 @@ end;
|
|||||||
|
|
||||||
procedure TX2GraphicList.DeleteImage(const AIndex: Integer);
|
procedure TX2GraphicList.DeleteImage(const AIndex: Integer);
|
||||||
begin
|
begin
|
||||||
BeginUpdate;
|
if CanConvert then
|
||||||
try
|
begin
|
||||||
Delete(AIndex);
|
BeginUpdate;
|
||||||
finally
|
try
|
||||||
EndUpdate;
|
Delete(AIndex);
|
||||||
end;
|
finally
|
||||||
|
EndUpdate;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
UpdateImageCount;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TX2GraphicList.MoveImage(const AOldIndex, ANewIndex: Integer);
|
procedure TX2GraphicList.MoveImage(const AOldIndex, ANewIndex: Integer);
|
||||||
begin
|
begin
|
||||||
BeginUpdate;
|
if CanConvert then
|
||||||
try
|
begin
|
||||||
Move(AOldIndex, ANewIndex);
|
BeginUpdate;
|
||||||
finally
|
try
|
||||||
EndUpdate;
|
Move(AOldIndex, ANewIndex);
|
||||||
|
finally
|
||||||
|
EndUpdate;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user