mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 02:19:39 +02:00
LCL/StringGrid: Fix crash when Columns are exchanged and column indices are specified in reverse order.
This commit is contained in:
parent
dcc2d5d0d5
commit
478e5101d9
@ -13226,8 +13226,15 @@ begin
|
||||
if HasIndex(Index) then
|
||||
if HasIndex(WithIndex) then begin
|
||||
BeginUpdate;
|
||||
Items[WithIndex].Index := Index;
|
||||
Items[Index+1].Index := WithIndex;
|
||||
if Index < WithIndex then
|
||||
begin
|
||||
Items[WithIndex].Index := Index;
|
||||
Items[Index+1].Index := WithIndex;
|
||||
end else
|
||||
begin
|
||||
Items[Index].Index := WithIndex;
|
||||
Items[WithIndex+1].Index := Index;
|
||||
end;
|
||||
EndUpdate;
|
||||
end else
|
||||
raise Exception.Create('WithIndex out of range')
|
||||
|
Loading…
Reference in New Issue
Block a user