mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 05:59:30 +02:00
LCL: TListItems formatting
git-svn-id: trunk@35535 -
This commit is contained in:
parent
8a4650a76e
commit
464767f88f
@ -278,27 +278,26 @@ var
|
|||||||
begin
|
begin
|
||||||
// Don't use IndexOf, it updates the cache, which then will become invalid
|
// Don't use IndexOf, it updates the cache, which then will become invalid
|
||||||
//DebugLn('TListItems.ItemDestroying ',dbgs(AItem));
|
//DebugLn('TListItems.ItemDestroying ',dbgs(AItem));
|
||||||
if (FCacheIndex <> -1)
|
if (FCacheIndex <> -1) and (FCacheItem = AItem) then
|
||||||
and (FCacheItem = AItem)
|
idx := FCacheIndex
|
||||||
then idx := FCacheIndex
|
else
|
||||||
else idx := FItems.IndexOf(AItem);
|
idx := FItems.IndexOf(AItem);
|
||||||
|
|
||||||
if idx = -1 then Exit; //?????
|
if idx = -1 then Exit; //?????
|
||||||
|
|
||||||
if FOwner <> nil
|
if FOwner <> nil then
|
||||||
then begin
|
begin
|
||||||
FOwner.ItemDeleted(AItem);
|
FOwner.ItemDeleted(AItem);
|
||||||
|
|
||||||
if (FOwner.HandleAllocated)
|
if (FOwner.HandleAllocated) and (lifCreated in AItem.FFlags) then
|
||||||
and (lifCreated in AItem.FFlags)
|
begin
|
||||||
then begin
|
|
||||||
Exclude(AItem.FFlags, lifCreated);
|
Exclude(AItem.FFlags, lifCreated);
|
||||||
TWSCustomListViewClass(FOwner.WidgetSetClass).ItemDelete(FOwner, idx);
|
TWSCustomListViewClass(FOwner.WidgetSetClass).ItemDelete(FOwner, idx);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if FCacheIndex = idx
|
if FCacheIndex = idx then
|
||||||
then FCacheIndex := -1;
|
FCacheIndex := -1;
|
||||||
FItems.Delete(idx);
|
FItems.Delete(idx);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user