LCL: Use IntegerList in PostScriptCanvas.

git-svn-id: trunk@56394 -
This commit is contained in:
juha 2017-11-13 17:33:34 +00:00
parent ce074563bb
commit 08cbd1a2bc

View File

@ -48,7 +48,7 @@ uses
Graphics, Forms, GraphMath, GraphType, IntfGraphics, Printers,
LCLType, LCLIntf, LCLProc, PostScriptUnicode,
// LazUtils
LazFileUtils, LazUTF8, LazUTF8Classes;
LazFileUtils, IntegerList, LazUTF8, LazUTF8Classes;
Type
@ -2386,7 +2386,7 @@ var
end;
var
LinesList: TFPList;
LinesList: TIntegerList;
LineStart, LineEnd, LineLen: integer;
ArraySize, TotalSize: integer;
i: integer;
@ -2399,15 +2399,15 @@ var
LineCount := 0;
exit;
end;
LinesList := TFPList.Create;
LinesList := TIntegerList.Create;
LineStart := 0;
// find all line starts and line ends
repeat
LinesList.Add({%H-}Pointer(PtrInt(LineStart)));
LinesList.Add(LineStart);
// find line end
LineEnd := FindLineEnd(LineStart);
LinesList.Add({%H-}Pointer(PtrInt(LineEnd)));
LinesList.Add(LineEnd);
// find next line start
LineStart := LineEnd;
if AText[LineStart] in [#10, #13] then
@ -2434,7 +2434,7 @@ var
while i < LinesList.Count do
begin
// add LineEnd - LineStart + 1 for the #0
LineLen :={%H-}PtrUInt(LinesList[i + 1]) -{%H-}PtrUInt(LinesList[i]) + 1;
LineLen := LinesList[i + 1] - LinesList[i] + 1;
Inc(TotalSize, LineLen);
Inc(i, 2);
end;
@ -2450,8 +2450,8 @@ var
// set the pointer to the start of the current line
CurLineEntry[i shr 1] := CurLineStart;
// copy the line
LineStart := integer({%H-}PtrUInt(LinesList[i]));
LineEnd := integer({%H-}PtrUInt(LinesList[i + 1]));
LineStart := LinesList[i];
LineEnd := LinesList[i + 1];
LineLen := LineEnd - LineStart;
if LineLen > 0 then
Move(AText[LineStart], CurLineStart^, LineLen);