mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 00:39:44 +02:00
LCL: Prevent a rare range error in ImageListResolution
git-svn-id: branches/fixes_2_0@60174 -
This commit is contained in:
parent
f001cc32ec
commit
b69c815f04
@ -333,7 +333,7 @@ end;
|
||||
|
||||
procedure TCustomImageListResolution.CheckIndex(AIndex: Integer;
|
||||
AForInsert: Boolean);
|
||||
// aviod exceptionframe generation
|
||||
// avoid exceptionframe generation
|
||||
procedure Error;
|
||||
begin
|
||||
raise EInvalidOperation.Create(SInvalidIndex);
|
||||
@ -364,10 +364,9 @@ begin
|
||||
Clear;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
CheckIndex(AIndex);
|
||||
|
||||
InternalMove(AIndex, FCount - 1, True);
|
||||
if AIndex < FCount-1 then
|
||||
InternalMove(AIndex, FCount-1, True);
|
||||
Dec(FCount);
|
||||
if HandleAllocated
|
||||
then TWSCustomImageListResolutionClass(WidgetSetClass).Delete(Self, AIndex);
|
||||
@ -641,8 +640,8 @@ end;
|
||||
Moves an image from the CurIndex'th location to NewIndex'th location
|
||||
without notifying the widgetset
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCustomImageListResolution.InternalMove(ACurIndex,
|
||||
ANewIndex: Cardinal; AIgnoreCurrent: Boolean);
|
||||
procedure TCustomImageListResolution.InternalMove(ACurIndex, ANewIndex: Cardinal;
|
||||
AIgnoreCurrent: Boolean);
|
||||
var
|
||||
ImgSize, DataSize: Cardinal;
|
||||
p: Pointer;
|
||||
|
Loading…
Reference in New Issue
Block a user