You've already forked lazarus-ccr
fpspreadsheet: Fix word wrap algorithm getting stuck if column width is smaller than the character width.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5222 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -737,6 +737,7 @@ procedure TsTextPainter.Prepare;
|
|||||||
var
|
var
|
||||||
lineInfo: TsLineInfo;
|
lineInfo: TsLineInfo;
|
||||||
ts: TTextStyle;
|
ts: TTextStyle;
|
||||||
|
oldPtr: PChar;
|
||||||
begin
|
begin
|
||||||
FTotalHeight := 0;
|
FTotalHeight := 0;
|
||||||
FMaxLinelen := 0;
|
FMaxLinelen := 0;
|
||||||
@ -756,7 +757,10 @@ begin
|
|||||||
lineInfo := TsLineInfo.Create;
|
lineInfo := TsLineInfo.Create;
|
||||||
lineInfo.pStart := FPtr;
|
lineInfo.pStart := FPtr;
|
||||||
lineInfo.BeginsWithFontOfRtpIndex := FRtpIndex;
|
lineInfo.BeginsWithFontOfRtpIndex := FRtpIndex;
|
||||||
|
oldPtr := FPtr;
|
||||||
ScanLine(lineInfo.NumSpaces, lineInfo.Width, lineInfo.Height, lineInfo.WordList);
|
ScanLine(lineInfo.NumSpaces, lineInfo.Width, lineInfo.Height, lineInfo.WordList);
|
||||||
|
if oldPtr = FPtr then // Detect scan is stuck
|
||||||
|
break;
|
||||||
FLines.Add(lineinfo);
|
FLines.Add(lineinfo);
|
||||||
FTotalHeight := FTotalHeight + IfThen(FTextRotation = rtStacked, 2, 1)*lineInfo.Height;
|
FTotalHeight := FTotalHeight + IfThen(FTextRotation = rtStacked, 2, 1)*lineInfo.Height;
|
||||||
FMaxLineLen := Max(FMaxLineLen, lineInfo.Width);
|
FMaxLineLen := Max(FMaxLineLen, lineInfo.Width);
|
||||||
@ -947,6 +951,8 @@ begin
|
|||||||
NextChar(1)
|
NextChar(1)
|
||||||
else
|
else
|
||||||
UTF8Delete(part, UTF8Length(part), 1);
|
UTF8Delete(part, UTF8Length(part), 1);
|
||||||
|
if part = '' then
|
||||||
|
EOL := true;
|
||||||
end;
|
end;
|
||||||
EOL := true;
|
EOL := true;
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user