View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0032447 | FPC | RTL | public | 2017-09-20 12:30 | 2017-09-20 16:24 |
Reporter | Michael Fuchs | Assigned To | Michael Van Canneyt | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.1.1 | Product Build | |||
Target Version | 3.2.0 | Fixed in Version | 3.1.1 | ||
Summary | 0032447: Add an AddList method to TFPGObjectList | ||||
Description | The TFPGObjectList has only the Assign method for adding another list. But the assign removes all existing entries. With an AddList method to list can be merged without the data loss. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 37268 | ||||
FPCOldBugId | |||||
FPCTarget | |||||
Attached Files |
|
|
addlist.patch (988 bytes)
Index: rtl/objpas/fgl.pp =================================================================== --- rtl/objpas/fgl.pp (Revision 37264) +++ rtl/objpas/fgl.pp (Arbeitskopie) @@ -181,6 +181,7 @@ procedure Insert(Index: Integer; const Item: T); {$ifdef FGLINLINE} inline; {$endif} property Last: T read GetLast write SetLast; {$ifndef VER2_4} + procedure AddList(Source: TFPGObjectList); procedure Assign(Source: TFPGObjectList); {$endif VER2_4} function Remove(const Item: T): Integer; {$ifdef FGLINLINE} inline; {$endif} @@ -1043,14 +1044,19 @@ end; {$ifndef VER2_4} -procedure TFPGObjectList.Assign(Source: TFPGObjectList); +procedure TFPGObjectList.AddList(Source: TFPGObjectList); var i: Integer; begin - Clear; for I := 0 to Source.Count - 1 do Add(Source[i]); end; + +procedure TFPGObjectList.Assign(Source: TFPGObjectList); +begin + Clear; + AddList(Source); +end; {$endif VER2_4} function TFPGObjectList.Remove(const Item: T): Integer; |
|
Patch added. |
|
Applied and expanded the patch, so all generic list objects have AddList, not just the object version. Thanks for the patch! |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-09-20 12:30 | Michael Fuchs | New Issue | |
2017-09-20 12:31 | Michael Fuchs | File Added: addlist.patch | |
2017-09-20 12:31 | Michael Fuchs | Note Added: 0102939 | |
2017-09-20 16:24 | Michael Van Canneyt | Fixed in Revision | => 37268 |
2017-09-20 16:24 | Michael Van Canneyt | Note Added: 0102945 | |
2017-09-20 16:24 | Michael Van Canneyt | Status | new => resolved |
2017-09-20 16:24 | Michael Van Canneyt | Fixed in Version | => 3.1.1 |
2017-09-20 16:24 | Michael Van Canneyt | Resolution | open => fixed |
2017-09-20 16:24 | Michael Van Canneyt | Assigned To | => Michael Van Canneyt |
2017-09-20 16:24 | Michael Van Canneyt | Target Version | => 3.2.0 |