mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 09:59:09 +02:00
MWE:
* Fixed bug on ListItems.Delete git-svn-id: trunk@1542 -
This commit is contained in:
parent
08109d2171
commit
790daedb9c
@ -420,7 +420,8 @@ type
|
|||||||
private
|
private
|
||||||
FOwner : TCustomListView;
|
FOwner : TCustomListView;
|
||||||
FItems : TList;
|
FItems : TList;
|
||||||
Function GetCount : Integer;
|
function GetCount : Integer;
|
||||||
|
procedure ItemDeleted(const AItem: TListItem); //called by TListItem when freed
|
||||||
protected
|
protected
|
||||||
function GetItem(const AIndex: Integer): TListItem;
|
function GetItem(const AIndex: Integer): TListItem;
|
||||||
procedure SetITem(const AIndex: Integer; const AValue: TListItem);
|
procedure SetITem(const AIndex: Integer; const AValue: TListItem);
|
||||||
@ -1782,6 +1783,10 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.29 2002/03/24 16:38:00 lazarus
|
||||||
|
MWE:
|
||||||
|
* Fixed bug on ListItems.Delete
|
||||||
|
|
||||||
Revision 1.28 2002/03/23 15:51:17 lazarus
|
Revision 1.28 2002/03/23 15:51:17 lazarus
|
||||||
MWE: Fixed more compatebility issues (Sort, SelectedItem)
|
MWE: Fixed more compatebility issues (Sort, SelectedItem)
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ destructor TListItem.Destroy;
|
|||||||
begin
|
begin
|
||||||
FDestroying := True;
|
FDestroying := True;
|
||||||
if FOwner <> nil
|
if FOwner <> nil
|
||||||
then FOwner.Delete(Index);
|
then FOwner.ItemDeleted(Self);
|
||||||
|
|
||||||
SubItems.Free;
|
SubItems.Free;
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
@ -90,6 +90,10 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.8 2002/03/24 16:38:01 lazarus
|
||||||
|
MWE:
|
||||||
|
* Fixed bug on ListItems.Delete
|
||||||
|
|
||||||
Revision 1.7 2002/03/23 15:49:22 lazarus
|
Revision 1.7 2002/03/23 15:49:22 lazarus
|
||||||
MWE: Fixed more compatebility issues (Sort, SelectedItem)
|
MWE: Fixed more compatebility issues (Sort, SelectedItem)
|
||||||
|
|
||||||
|
@ -54,10 +54,19 @@ end;
|
|||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
procedure TListItems.Delete(const AIndex: Integer);
|
procedure TListItems.Delete(const AIndex: Integer);
|
||||||
begin
|
begin
|
||||||
if (FItems.Items[Aindex] <> nil)
|
Item[AIndex].Delete;
|
||||||
then Item[AIndex].Delete;
|
end;
|
||||||
FItems.Delete(AIndex);
|
|
||||||
FOwner.ItemDeleted(AIndex);
|
{------------------------------------------------------------------------------}
|
||||||
|
{ TListItems ItemDeleted }
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TListItems.ItemDeleted(const AItem: TListItem);
|
||||||
|
var
|
||||||
|
idx: Integer;
|
||||||
|
begin
|
||||||
|
idx := FItems.Remove(AItem);
|
||||||
|
if (idx >= 0) and (FOwner <> nil)
|
||||||
|
then FOwner.ItemDeleted(idx);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
@ -111,6 +120,10 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.10 2002/03/24 16:38:01 lazarus
|
||||||
|
MWE:
|
||||||
|
* Fixed bug on ListItems.Delete
|
||||||
|
|
||||||
Revision 1.9 2002/03/23 15:49:22 lazarus
|
Revision 1.9 2002/03/23 15:49:22 lazarus
|
||||||
MWE: Fixed more compatebility issues (Sort, SelectedItem)
|
MWE: Fixed more compatebility issues (Sort, SelectedItem)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user