|
@@ -3224,19 +3224,34 @@ end;
|
|
|
|
|
|
function TStrings.GetNextLinebreak(const Value: String; out S: String; var P: Integer): Boolean;
|
|
function TStrings.GetNextLinebreak(const Value: String; out S: String; var P: Integer): Boolean;
|
|
|
|
|
|
-Var
|
|
|
|
- PP : Integer;
|
|
|
|
|
|
+var
|
|
|
|
+ PPLF,PPCR,PP,PL: Integer;
|
|
|
|
|
|
begin
|
|
begin
|
|
S:='';
|
|
S:='';
|
|
Result:=False;
|
|
Result:=False;
|
|
If ((Length(Value)-P)<0) then
|
|
If ((Length(Value)-P)<0) then
|
|
- exit;
|
|
|
|
- PP:=TJSString(Value).IndexOf(LineBreak,P-1)+1;
|
|
|
|
- if (PP<1) then
|
|
|
|
|
|
+ Exit;
|
|
|
|
+ PPLF:=TJSString(Value).IndexOf(#10,P-1)+1;
|
|
|
|
+ PPCR:=TJSString(Value).IndexOf(#13,P-1)+1;
|
|
|
|
+ PL:=1;
|
|
|
|
+ if (PPLF>0) and (PPCR>0) then
|
|
|
|
+ begin
|
|
|
|
+ if (PPLF-PPCR)=1 then
|
|
|
|
+ PL:=2;
|
|
|
|
+ if PPLF<PPCR then
|
|
|
|
+ PP:=PPLF
|
|
|
|
+ else
|
|
|
|
+ PP:=PPCR;
|
|
|
|
+ end
|
|
|
|
+ else if (PPLF>0) and (PPCR<1) then
|
|
|
|
+ PP:=PPLF
|
|
|
|
+ else if (PPCR > 0) and (PPLF<1) then
|
|
|
|
+ PP:=PPCR
|
|
|
|
+ else
|
|
PP:=Length(Value)+1;
|
|
PP:=Length(Value)+1;
|
|
S:=Copy(Value,P,PP-P);
|
|
S:=Copy(Value,P,PP-P);
|
|
- P:=PP+length(LineBreak);
|
|
|
|
|
|
+ P:=PP+PL;
|
|
Result:=True;
|
|
Result:=True;
|
|
end;
|
|
end;
|
|
|
|
|