diff --git a/rtl/objpas/classes/classesh.inc b/rtl/objpas/classes/classesh.inc index 4fa55ba9d4..ad2417cab1 100644 --- a/rtl/objpas/classes/classesh.inc +++ b/rtl/objpas/classes/classesh.inc @@ -627,6 +627,7 @@ type procedure SetQuoteChar(c:Char); procedure SetNameValueSeparator(c:Char); procedure WriteData(Writer: TWriter); + procedure DoSetTextStr(const Value: string; DoClear : Boolean); protected procedure DefineProperties(Filer: TFiler); override; procedure Error(const Msg: string; Data: Integer); @@ -655,6 +656,7 @@ type procedure Append(const S: string); procedure AddStrings(TheStrings: TStrings); overload; virtual; procedure AddStrings(const TheStrings: array of string); overload; virtual; + Procedure AddText(Const S : String); virtual; procedure Assign(Source: TPersistent); override; procedure BeginUpdate; procedure Clear; virtual; abstract; diff --git a/rtl/objpas/classes/stringl.inc b/rtl/objpas/classes/stringl.inc index abeeb92ac5..f7af390a2e 100644 --- a/rtl/objpas/classes/stringl.inc +++ b/rtl/objpas/classes/stringl.inc @@ -557,7 +557,7 @@ begin Result:=True; end; -Procedure TStrings.SetTextStr(const Value: string); +Procedure TStrings.DoSetTextStr(const Value: string; DoClear : Boolean); Var S : String; @@ -566,7 +566,8 @@ Var begin Try beginUpdate; - Clear; + if DoClear then + Clear; P:=1; While GetNextLine (Value,S,P) do Add(S); @@ -575,7 +576,17 @@ begin end; end; +Procedure TStrings.SetTextStr(const Value: string); +begin + DoSetTextStr(Value,True); +end; + +Procedure TStrings.AddText(const S: string); + +begin + DoSetTextStr(S,False); +end; Procedure TStrings.SetUpdateState(Updating: Boolean);