mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 10:55:54 +02:00
LCL: TListViewItems: do not call ws ItemExchange() or ItemMove() if OwnerData = True.
git-svn-id: trunk@31368 -
This commit is contained in:
parent
a0933e1606
commit
fe54d8652c
@ -154,12 +154,11 @@ begin
|
|||||||
raise Exception.CreateFmt(rsListIndexExceedsBounds, [AIndex1]);
|
raise Exception.CreateFmt(rsListIndexExceedsBounds, [AIndex1]);
|
||||||
if (AIndex2 < 0) or (AIndex2 >= FItems.Count) then
|
if (AIndex2 < 0) or (AIndex2 >= FItems.Count) then
|
||||||
raise Exception.CreateFmt(rsListIndexExceedsBounds, [AIndex2]);
|
raise Exception.CreateFmt(rsListIndexExceedsBounds, [AIndex2]);
|
||||||
|
|
||||||
AItem := Item[AIndex1];
|
AItem := Item[AIndex1];
|
||||||
FItems.Exchange(AIndex1, AIndex2);
|
FItems.Exchange(AIndex1, AIndex2);
|
||||||
FCacheIndex := AIndex1;
|
FCacheIndex := AIndex1;
|
||||||
FCacheItem := AItem;
|
FCacheItem := AItem;
|
||||||
if WSUpdateAllowed then
|
if not Owner.OwnerData and WSUpdateAllowed then
|
||||||
begin
|
begin
|
||||||
TWSCustomListViewClass(FOwner.WidgetSetClass).ItemExchange(FOwner, AItem,
|
TWSCustomListViewClass(FOwner.WidgetSetClass).ItemExchange(FOwner, AItem,
|
||||||
AIndex1, AIndex2);
|
AIndex1, AIndex2);
|
||||||
@ -180,7 +179,7 @@ begin
|
|||||||
FItems.Move(AFromIndex, AToIndex);
|
FItems.Move(AFromIndex, AToIndex);
|
||||||
FCacheIndex := AToIndex;
|
FCacheIndex := AToIndex;
|
||||||
FCacheItem := AItem;
|
FCacheItem := AItem;
|
||||||
if WSUpdateAllowed then
|
if not Owner.OwnerData and WSUpdateAllowed then
|
||||||
begin
|
begin
|
||||||
TWSCustomListViewClass(FOwner.WidgetSetClass).ItemMove(FOwner, AItem,
|
TWSCustomListViewClass(FOwner.WidgetSetClass).ItemMove(FOwner, AItem,
|
||||||
AFromIndex, AToIndex);
|
AFromIndex, AToIndex);
|
||||||
|
Loading…
Reference in New Issue
Block a user