mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-12 18:20:03 +02:00
LazUtils: Improve UTF8WrapText. Issue #28259, patch from Antônio Galvão.
git-svn-id: trunk@49300 -
This commit is contained in:
parent
edabee3db9
commit
6cf8c56cfc
@ -2749,7 +2749,7 @@ var
|
||||
ResultLen, RP :Integer;
|
||||
begin
|
||||
Result := '';
|
||||
if (S = '') or (BreakStr = '') or (BreakChars = []) then Exit;
|
||||
if (S = '') or (MaxCol = 0) or (BreakStr = '') or (BreakChars = []) then Exit;
|
||||
P := PChar(S);
|
||||
while P^ <> #0 do
|
||||
begin
|
||||
@ -2774,7 +2774,7 @@ begin
|
||||
while not (Result[RP] in BreakChars) do
|
||||
Dec(RP);
|
||||
RightSpace := Len - RP;
|
||||
if RightSpace > 0 then
|
||||
if (RightSpace > 0) and (RightSpace < MaxCol) then
|
||||
begin
|
||||
Dec(P, RightSpace);
|
||||
SetLength(Result, Len - RightSpace);
|
||||
|
Loading…
Reference in New Issue
Block a user