* Added AddText as suggested in bug ID #24764

git-svn-id: trunk@25129 -
This commit is contained in:
michael 2013-07-19 07:16:06 +00:00
parent 4b93fa1323
commit 4afefd6cbe
2 changed files with 15 additions and 2 deletions

View File

@ -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;

View File

@ -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);