Browse Source

* TStringlist constructor with ownsobjects parameter, Delphi compatible + empty constructor to avoid compiler getting confused

marcoonthegit 3 years ago
parent
commit
2457016671
2 changed files with 12 additions and 1 deletions
  1. 2 1
      rtl/objpas/classes/classesh.inc
  2. 10 0
      rtl/objpas/classes/stringl.inc

+ 2 - 1
rtl/objpas/classes/classesh.inc

@@ -849,8 +849,9 @@ type
     procedure InsertItem(Index: Integer; const S: string); virtual;
     procedure InsertItem(Index: Integer; const S: string; O: TObject); virtual;
     Function DoCompareText(const s1,s2 : string) : PtrInt; override;
-
   public
+    Constructor Create;
+    Constructor Create(anOwnsObjects : Boolean);
     destructor Destroy; override;
     function Add(const S: string): Integer; override;
     procedure Clear; override;

+ 10 - 0
rtl/objpas/classes/stringl.inc

@@ -1886,6 +1886,16 @@ begin
 end;
 
 
+Constructor TStringList.Create;
+begin
+  inherited Create;  
+end;
+
+Constructor TStringList.Create(anOwnsObjects : Boolean);
+begin
+  inherited Create;
+  FOwnsObjects:=anOwnsObjects; 
+end;
 
 destructor TStringList.Destroy;