mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 21:04:09 +02:00
LCL: TTextStrings: assign(TTextStrings): simple copy
git-svn-id: trunk@47305 -
This commit is contained in:
parent
0cbf0e3443
commit
139a7cacb9
@ -728,8 +728,33 @@ var
|
||||
s: String;
|
||||
i: Integer;
|
||||
AddEachLine: Boolean;
|
||||
SrcTextStrings: TTextStrings;
|
||||
SrcItem: PTextLineRange;
|
||||
DstItem: PTextLineRange;
|
||||
begin
|
||||
if TheStrings.Count=0 then exit;
|
||||
if FLineCount=0 then begin
|
||||
if TheStrings is TTextStrings then begin
|
||||
// copy Text, lineranges
|
||||
SrcTextStrings:=TTextStrings(TheStrings);
|
||||
FText:=SrcTextStrings.Text;
|
||||
ClearArrays;
|
||||
if not SrcTextStrings.FArraysValid then exit;
|
||||
// copy line range list
|
||||
FLineCount:=SrcTextStrings.Count;
|
||||
FLineCapacity:=FLineCount;
|
||||
FLineRanges:=AllocMem(FLineCount*SizeOf(TTextLineRange));
|
||||
SrcItem:=SrcTextStrings.FLineRanges;
|
||||
DstItem:=FLineRanges;
|
||||
for i:=0 to FLineCount-1 do begin
|
||||
DstItem^:=SrcItem^;
|
||||
inc(SrcItem);
|
||||
inc(DstItem);
|
||||
end;
|
||||
FArraysValid:=true;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
AddEachLine:=false;
|
||||
if FArraysValid then begin
|
||||
for i:=0 to FLineCount-1 do
|
||||
|
Loading…
Reference in New Issue
Block a user